Cows are not deserving of basic rights. Kantian ethics, a form of ethics often used to justify so called basic rights is often based on, suggests that the ability to be a moral actor, and as such have moral worth, comes from our rationality. As such we only have a moral duty to respect the ends of other rational consciousnesses. Cows are not rational actors and as such are not deserving of rights.
On the other hand utilitarian ethics, an ethical system based on maximizing pleasure and minimizing pain, posits that all consciousnesses that feel pleasure and pain possess moral worth. Under this framework cows still don't deserve rights, however as inhumane factory conditions likely produce more pain then the pleasure gained by humans drinking milk, they could be said to be unethical