The EU car insurance ruling is a thing of beauty because it rules out most of the theories of why the EU does the things it does.
There is no possible ideology behind requiring insurers to ignore risk factors. There is no favoured class which will benefit — even the benefit to young male drivers will be very minor*, and there is certainly no general EU intention to benefit that class. There is no practical benefit. The only reason for the EU to decide to interfere in this particular question is because it can.
And there is nothing irrational in that. The EU wants to interfere in as much as possible, regardless of the lack of any justification, because everything it can touch increases its relevance — its power. This creates jobs for people to check that car insurance rates are in compliance. It creates opportunities for deals, exceptions, opt-outs, and straight out bribes. That is a sound, logical course action for a self-styled government with no country.
*since if the insurers adjust rates to bring in the same revenue as before, the effect will be to discourage low-risk female drivers and encourage high-risk male drivers, which will cost the insurers a lot more in claims — therefore the insurers will have to set the rate much higher than the weighted average of what it charges now, and accept a corresponding fall in business.