All seems very tokenistic to me, it's like they are supposed to join a service for a minimally agreed period, before bowing out.
Look, there is nothing in the constitution to say they couldn't have led a playboy life of idleness until the time came to ascend to the throne (in William's case) if they'd wanted (plenty of precedent for that). Instead both have chosen to put themselves in harm's way and do a useful job when they didn't have to.
As regards minimum time required, when I joined there were still 5 and 8 year short service commissions on offer, and further back many Vampire pilots were doing extended National Service for 3 years, IIRC.