Yes the monarchy is Commander-In-Chief, some affiliation IMO doesn't mean a total of nearly 10 years training for him to just automatically become Commander-In-Chief.
Prince Harry has managed to complete frontline service and he is 3rd in line to the throne.
Why not?
He needs to fully understand how the military system works, in order to better perform his duties as a monarch, when the time comes.
That doesn't necessarily mean frontline service. In many countries that would be a problem, as for many countries the nearest thing they came to a war was serving as peacekeepers. (A highly political task, so almost certainly a no, no for a royal).
Andrew served in Falklands War, but Charles didn't serve in Yemen or Northern Ireland, which would have been an option. (That these theatres of operations were highly political and volatile is another matter).
Harry is to put it brutally, a spare. Personally I respect him for serving, but I would also have been against it, if I was British. Royals are bullet magnets. Bullets however, have a tendency to miss their targets and hit those nearby instead...
And as you know he was immediatly pulled out, once his cover was blown.
If William was to serve anywhere near Afghanistan, litterally thousands would do anything to have a go at any British soldier in the hope of hitting William, and that sort of goes against the purpose of the soldiers being there in the first place.
No, every life William and his crew save with their helicopter home in Britain is worth it all, in my opinion.