It is a debatable practice, yet I think this is somewhat protecting the children from silly decisions of parents (some example from Hungarian tabloid media where parents were outraged: Fradi / Fradika (from the slang name Fradi of the FTC football club, without and with diminutive appendix), Traktorka (tractor with diminutive appendix), various names from soap operas, WoW characters, Shrek, Satan.
So think of the children! :) But really, this is the other end of the spectrum. And this (giving especially weird names to children) is a fine recipe for making the child subject to bullying in my opinion.
Australia seems to have a good policy where any name is allowed, as long as it isn't offensive or too silly.
Musk's children's name would be fine, for example, while calling a kid Hitler would not be.
Also we have the idea of "nameday" which is minor occasion for celebration and giving small gifts every year, based on the person's given name, and the calendar contains the mapping between names and dates, one without an official name would be in trouble getting that free a bottle of wine :D
IMO only the names that would be damaging beyond a reasonable doubt should be prohibited.
Also, the nameday idea sounds cool :)