Well that's not entirely true.
According to Whitney, one night after filming had wrapped on an episode, she was having a private drink with one of the show’s executives (she never reveals who), and was sexually assaulted by him. Apparently embarrassed by the incident, he had her character written out of the show so he wouldn’t have to face her on an on-going basis. As a result, she spent many years feeling extremely bitter over the entire experience and sank deeper into an already existing drink and drugs problem.
However like most stories there are other sides too.
There's a story that Roddenberry got rid of her because she refused to sleep with him, and another story where Majel Barrett felt there were to many women in the main cast on the show and Yeoman Rand was the only one they could write off without to much bad press.
We will never really know the truth. However given Whitney actually wrote and spoke about the assault, while also acknowledging her own struggles with substance abuse, I'm more inclined to believe her story.