When it comes to evolution, I think you can only really WAG an answer, since there’s no way to go back and run a variety of control groups who do and don’t go through the same environmental shifts, to figure it which shift caused what change.
One thing that does seem to be true is that some portions of the body have fewer blood vessels coming in. The top of the head is one of these places and, to maintain hair, the body has to stretch them all the way just to maintain some hair. There’s nothing else in that region. Lower down, you have the ears, the spine, various neck muscles, etc. that also need blood flow and where that flow is far less optional. If the body does decide that it’s a PITA to have all these long veins all over the place, reducing the ones that go over the top of the skull is the one best option.
Some other things that seem to be true are that hair loss seems to be triggered by testosterone and, specifically, by a specific subtype of testosterone called dihydrotestosterone that seems to be intended to trigger changes in the body as you age (e.g. spurring your body to start producing hair “down there” when you hit puberty and, later, to start losing hair).
If we think of testosterone principally as a hormone tied to athletic capability then prioritizing blood flow to the muscles - as said above - might be one change it could make. But likewise, we might consider the baldness to be an indicator of strength and so it makes you look more fierce on the battlefield. Men who are bald do tend to look a little more “skullish” than people with a full head of hair so that might be an additional or primary bonus.
Alternately, of we think of testosterone principally as a product of aging and of the body being signaled to morph into its next form, then - again - we might consider blood flow efficiency. You no longer need to look quite as handsome and dashing, with sparkly hair, to catch attention. The plumage is an unnecessary waste of energy.
But another possibility could be something to do with sun exposure. The longer you live, the more likely you are to get cancer and the Sun is the #1 source of cancer-causing rays. The top of your head is probably the one location that is the most strongly hit by the sun’s rays and thus - plausibly - the most location to start forming a cancerous growth if the body doesn’t somehow adapt to it.
Plausibly the shielding effect of the hair is less effective than cutting off blood flow to that area, in terms of making it hard for a cancer to grow? Maybe as people bald and start to get sunburns on the top of their head, they’re more likely to start fashioning hats - which are just more effective than hair?
No idea, just theories.