Hamlet is not saying that words are "whores." He is alluding to whores who were notorious for using bad language, especially when they were angry. Since they were women they were not likely to try using physical violence against men but would curse them for one reason or another. The whores were also in danger of arrest and corporal punishment if they became too troublesome.
There is another place in the play where Hamlet seems to express an unfavorable opinion of words. That is where he has the following exchange with Polonius, who keeps pestering him while he is trying to read his book:
Polonius What do you read, my lord?
Hamlet Words, words, words.
Hamlet may think that words can be false, tedious, boring, or meaningless, but he does not call them "whores" in his conversation with Polonius.
Writers may have many problems with words and may become sick and tired of working with them, wondering whether they do any good or even whether they have any meaning. Plato has Socrates say the following about words in a myth he makes up to entertain his young companion in the famous dialogue titled Phaedrus:
And you now, the father of written letters [Theuth], are led by your affection to ascribe to them a power exactly the reverse of what their tendency is. The result of your invention will be this: in the souls of those who learn it, forgetfulness will have lodging through a want of cultivation of the memory; they will trust to writing, a thing outside themselves, and effected by external characters, and hence will not remember of themselves and from within. The elixir you have found is not an aid to memory, but to reminiscence. You provide your pupils with the show of wisdom, not true wisdom. Through you they will learn many things without instruction, and will hence appear to have much knowledge while for the most part they are ignorant, and hardly to be endured because they are grown seeming wise instead of wise.
It may be that Hamlet is thinking something similar when he berates himself for unpacking his heart with words and also when he tells Polonius that he is reading nothing but words, words, words.