…in the short term.
In the long term, if they prevent cycling from ever becoming a viable alternative to driving, then they’re still worse.
If someone is interested in trying a bike from one of those sharing locations, but they don’t have a helmet, they won’t try the bike in the first place. Especially if a city law makes a bike-sharing app “validate” that you’re wearing a helmet, to enforce the law, before giving you a bike.
Fewer people try the idea of riding a bike around their town, so there’s more pushback against improved cycling infrastructure because “it would never benefit me”, so there’s less infrastructure investment.
Continued ad nausium, cycling is less safe due to the limited number of people who are willing to advocate for safer infrastructure in the first place, which makes a much larger difference to safety than helmets.
That’s the idea.