For a novel about a trial, there seems to be an awful lot of hanky-pankying going on. No matter how deeply the main character gets mired in his trial, he always seems to have time to flirt and seduce. While we never find out exactly what Josef K. is guilty of in The Trial, all of the sex he's having points to one of the main sources of guilt and shame in human society: sex. Both sex and criminality are aspects of human behavior that are associated with shame. But our shame concerning all matters sexual may be a more fundamental fact of being human than criminality, because sexuality is a quality we all share. If to be human is to be sexual, and to be sexual is to be guilty in the eyes of society, then according to this really depressing social equation, we are all guilty without having done anything wrong. K.'s robust sexuality suggests that his unspecified crime may just be the simple fact of his being human.
In The Trial, sexuality serves as an allegory for the corruptibility of the courts.
The women associated with the courts serve as a different trial for K., giving him the opportunity to prove that his guilt is undeserved. Unfortunately, he fails this trial and his promiscuous sex life gives him another cause for shame.