Legalizing LSD would not make it any safer.
I think you are wrong. LSD has been used for along time by alot of people, hardly any deaths ever from it (maybe one I recall reading about but I think that person may have injected it or had an insane amount or something) anyway, alot of the harm is coming from things sold as lsd, that are sometimes even mentioned as lsd by the media (as the trips are made to look exactly like lsd) but actually contain a totally different chemical that can be alot more potent than lsd. If lsd for example was legal, people would be getting real lsd, not nbome or dox, and would also be getting a set dose and not having bad trips as you mentioned.
It's the same with 'ecstasy' most of the harm comes from Adulterated batches because of no regulation, and no set doses, who know what's in it, who's made it, in what environment, and how much active ingredients it has in it etc.
Same with cannabis, because it is so illegal in most of the world, we have synthetic cannabis, which alot of people are using, sometimes to avoid drug testing for cannabis. With synthetic cannabis we have already seen more deaths than with lsd, and synthetic cannabis is only a relatively new product. If real cannabis was legal, people wouldnt have to use synthetic cannabis at all, thus less people having health issues and or dying.
The money from legalised drugs (be it mdma, lsd, cannabis, whatever) could be wisely used to fund things like more rehabs and detox centres and more education and public awareness ads and campaigns, kind of like we are seeing now with tobacco products in many places in the world. I think I read recently that tobacco is the only recreationally used drug that is in decline in its use and they said that was from the public awareness campaigns and education.
Loads of people have issues with cannabis for their health too, it can be a dangerous drug for some people to use, people can crash cars and do all sorts of stupid shit, but still alot of people can use it responsibly with no problems at all, same with lsd, mdma, meth, heroin, and even more so if the doses and ingredients are all listed on the packaging along with quit lines and help lines and other things like that.
people would still die from dancing for hours while high without drinking water.
I doubt it, I don't know how many people have died directly from that over the time ecstasy has been used (which would be over 40 odd years and by millions and millions of people worldwide) but I'd guess it's a pretty small amount, I hear more about people dying whilst on it from drinking too much water, these issues could be addressed with awareness ads and info on the packaging when it is sold, so more people know of both those risks.