The myth that a former employer cannot say anything about why you left the company is probably perpetuated by the widespread practice of many employers to only confirm dates of employment, job titles, and salary when responding to inquiries from prospective employers.
The law generally permits former employers to tell prospective employers why an employee left and whether the employee was considered a good worker, as long as the information given is truthful. Even if the former employer gives inaccurate information about a former employee, the law provides some protection against liability in the form of a "qualified privilege" as long as the information given was not deliberately false. The qualified privilege exists to promote the free exchange of information between former and prospective employers about job applicants.
With this kind of protection against liability, one might ask why California employers would restrict the kind of information they will reveal to prospective employers? The answer lies in the harsh penalties imposed under the California Labor Code for making false statements to prevent a former employee from getting a new job.
California Labor Code section 1050 provides:
"Any person, or agent or officer thereof, who, after having discharged an employee from the service of such person or after an employee has voluntarily left such service, by any misrepresentation prevents or attempts to prevent the former employee from obtaining employment, is guilty of a misdemeanor."
Labor Code section 1052 imposes a duty on the employer "to take all reasonable steps within his power to prevent" his agents, managers, and employees from making such misrepresentations.
In addition to criminalizing this kind of conduct, Labor Code section 1054 authorizes the aggrieved employee to file a lawsuit against the former employer to recover treble damages, which means three times the amount of money the employee lost because of the misrepresentation. If the employee sues, she not only must prove the statement was false and was made to prevent her from being hired, but also that the statement was the only reason for (or a subtantial factor in) the decision not to hire her.
An additional challenge for the suing employee is proving the actual amount of monetary loss. Because most employment arrangements are "at-will" and for an indefinite period of time, it can be somewhat uncertain how long the employee would likely have worked if she had been hired.
Even with the qualified privilege against liability for honest mistakes when giving employment references, many employers will not give detailed information out of concern about lawsuits contending erroneous information was given with a deliberate design to prevent the former employee from being hired elsewhere because, for example, the prospective employer is a competetitor of the former employer or the person giving the reference personally disliked the former employer.

