In my country, it's legal and widely used, so much so the government entity that is supposed to look out for the workers provides a template for employers with suggested questions you should ask which even go as far as the person's reason given for leaving, their work performance and if you would re-hire them.
That's... oppressive. If you don't want to say the country, what continent is it?
Guess I better produce some proof before I get even more down votes... https://www.fairwork.gov.au/ArticleDocuments/766/Reference-c...
In what country / region / province do you work? I understand it is actually unlawful for an employer to give or ask for references in the US, and perhaps even Europe.