Morals are nice, but if you're being underpaid purely based on your previous salary vs actual worth, then it doesn't do you much good except to feel good.
If I'm underpaid it's because I took a job with bad pay. Presumably because I failed to demonstrate I was worth more, was incorrect about being worth more, or I chose to accept an offer that didn't match my value.
I can take personal responsibility for any of those scenarios. Transparency is not the root cause of them. Taking responsibility is in general a better option than assigning blame. Acting in bad faith because of perceived bad faith just feeds into a downward spiral that makes the world worse for everyone. You don't act right because it feels good, there are practical reasons for it.
I think blaming people for letting themselves get screwed is rather egregious when firms have every incentive to screw you. In a lot of situations, its either you take the job offer or you don't eat. How long do you think most people can survive unemployment?
That assumes you feel lying is wrong only because of the circumstances of getting caught vs. valuing honesty for its own sake.