The only rational argument for these laws would be the burden on the national-health system for injuries sustained on the head during riding a bike. This could be solved by allowing people to opt-out of the free national health system coverage explicitly in these instances of injuries, if indeed statistics show that there is a significant burden imposed on it. And still there is the counter-argument that this would be biased -what about people who are engaging into leisure activities with higher-risk, "extreme-sports" and such. I wouldn't be surprised if even the cost of treating normal sports-related injuries is higher than the cost of head-related injuries of bikers riding with no helmet. Why not enforce wearing full protective gear when engaging in every sport?
If we start with this mentality, it's only a slippery slope that would lead us in a place we don't want to be.
Same as with smoking taxes. It started with the justification that it's fair to counteract the increased cost that smokers have on the national health system. A perfectly fair reasoning. But by now these taxes have increased so much that this justification is no longer convincing -instead they are widely accepted as a sort of "luxury tax" that smokers pay, no longer to cover the cost of the medical treatment they are more likely to receive on average, but just "because that's how it is". This income is not even earmarked for the health system in many cases. They also started covering things that evidence don't support they pose any or as much of a risk as cigarette smoking (Vaping), and in some cases -Italy, IIRC-, even with official lawmaker justification that these products deprive the state from tax income that they would receive through the smoking tax. A completely illogical argument that I was surprised to see it made nobody blink twice.
So I think such laws are really a demonstration of government acting as a for-profit entity, squeezing money from whatever they think they can get away with.