These laws don't violate the privacy of every computer user. They say that a parent shall be able to mark a child's account as being under 18, and apps shall respect that.
Assuming apps for which this is relevant respect users and specifically children in this day and age sounds naive. It's another free datapoint to collect, in the best case for targeted ads.