IMO the most important profession, and definitely the most valuable (or destructive) to society, is political leadership. Poor political leadership results in either your country being conquered and potentially wiped out e.g. Carthage, Aztecs/Incas; or it being independent but turning into a complete hellhole and/or exterminate its own people e.g. USSR, Zimbabwe, N Korea, Cambodia etc; or it vastly underperforming its potential e.g. China, Brazil, India.
The next most important is the armed forces. If you have a crap army and generals and an enemy has a great one, you are dead meat.
Everything else is pretty much secondary. Some people mention things like police or doctors. They forget that up until Robert Peel, most countries didn't actually have any police force. So for all but 200 years of human history, *police didn't exist*. We got by reasonably with just vigilantism and court-appointed bailiffs.
Ditto with doctors. Up until around the 17th century, treatment by a doctor actually *increased mortality*, because most of their treatments were harmful e.g. leeching, blood-letting and so on. Again, humans existed for thousands of years without any competent doctors.
Sure, both of them provide a very useful service. But N Korea has doctors and police, and I wouldn't want to live there. The high seas have no doctors and no police, and I'd be fine sailing round the world for a year or two. Saudi Arabia or Iran would be better off with no police than its current police force.