So all in all we have a cautionary tale about the perils of hiding your daughters away from the world (especially once they reach puberty) and the consequences of premarital sex.
Another interesting scene is where Rapunzel's father agrees to give up his first born child because he's been caught stealing food from the fairy's garden. To my untrained eye this seems to be a commentry on feudalism, where a serf who dared pilfer food from his overlord's fields, even if he was starving, would face consequences far in excess of his crime.
You can read D.L. Ashliman's excellent side-by-side translation of the Grimms's 1812 and 1857 versions of 'Rapunzel' by clicking on the link below: