can they do that?
Family Law Attorney
There is no law that would require the former employer to help you in getting a job (unless you have an agreement with the former employer to do so).
What may have happened is that the employer knew you by some other name or that the person answering the phone did not know about you.
Some employers are wary of being sued and would not give out any information about any employee.
If the relationship between you and the former employer is not good, you may want to reconsider using that employer as a reference.
In WA, employees and former employees have a right to reasonable access of their personnel records. If showing that you did work for this employer is needed, you can get copies of written records from your personnel file to show that you worked there.
Employment / Labor Attorney
I would look into this further. Make sure your previous employer remembers you and this was not intentional. If it was an intentional lie about your previous work history, you may have a case for defamation of character (either libel or slander depending on whether the lie is written or oral) against your previous employer. There are several other legal theories that might work, and are at least worth asserting, in a case against your previous employer. This is only assuming the employer knew you worked there and intentionally lied about that fact to inquiring parties. Hopefully it was just an accident.