Asking doesn't hurt anyone. However giving certain answers could. What prevents employees from claiming that this information is "confidential" (polite version of "it's not your business"). Or outright lying about it?
Claiming the information is confidential may hurt your chances of getting the job, or simply get the "we need this information or we can't continue, sorry, it's policy" answer.
Lying about it benefits the liars (assuming they lie intelligently). I suspect that offers are frequently based on previous pay, so simply claiming your previous pay was higher would get you a better offer. Is lying really the behavior we want to incentivize?