Maybe this is just bait, but this is already how it works. I'll go over US law, but other countries likely have similar processes.
Legislation needs to have justification for restricting people, or it gets overturned when challenged. This is because it would fail the strict scrutiny test, making it unconstitutional. It needs to be "narrowly tailored" to a "legitimate government interest" to pass. In other words, it needs to be focussed on addressing a problem the government acknowledges some responsibility to solve, and do so in a way that doesn't cause undue restrictions beyond that goal.
Creating a law isn't an easy process, so they are made with purpose. That doesn't mean every law is a good law, but that's why we have these processes for reform after all. Sometimes you have old nonesense laws remain, but that is typically because they are unenforced or too detached from modern life for anyone to care to remove them.