A registered nurse ill treated and sexually assaulted patients and used racist and homophobic language at work, a court heard.