Knowing a candidate's compensation history can save an employer a significant amount of money which they otherwise might've spent on the same candidate. This gives them an unfair advantage, and the way I see it, it's unavoidable to remove this advantage. By restricting employers from asking about previous compensation, we're just shifting this advantage to the employees, for better or worse.
Can you actually rationalise your argument a little further? Why on earth should your salary for a new role be benchmarked to your previous compensation? Do you realise how ridiculous that sounds? Ultimately, the market sets some value for a role - largely based on competitor analysis - and that is a fair value. Your previous pay is irrelevant.