These groups of people are often portrayed as being physically threatening. This is a consequence of the combination of two types of prejudice. First, men are often considered to be more threatening because of their physical strength and personality traits. The second factor is that men who belong to a minority group are often considered to be more threatening than white people (this is also the case for African American men). These prejudices can have a significant impact on the lives of men who belong to these groups.
In this case Hamlet's soliloquy serves the purpose of informing the audience of his intense negative feelings toward his mother's remarriage and highlighting the inner turmoil those feelings create within him.