Sexual activity in a dream is asking you to get intimately in touch with your male side, if you are having sex with a man; your female side, if with a woman. We all have male and female aspects to ourselves and each have unique traits. For example, compassion, listening, leadership, feelings and your philosophy of life work through your female side. Confidence, belief in yourself, feeling worthy of the space you occupy, career and spiritual healing work through your male side. The dream may be triggered due to an imbalance which is affecting your ability to develop or move forward in an aspect of your life related to a particular energy. The dream tries to heal this by representing your male or female side as something desirable.
The dream wants both male and female sides of yourself to share closeness in an uninhibited way. This sharing restores balance, so dreams can draw on the strength inherent in the aspect of your nature that is repressed. Many people are shocked to find themselves having sex in a dream with a person of the same sex. This still has the same meaning. A woman having sex with another woman in a dream is still a healing device intended to put the dreamer in close contact with her heart / feelings.
Dreams can also include members of the family in sexual roles with the dreamer. Here the intent is to use an existing loving relationship as a pull to seduce the dreamer into having sex, and therefore accept the healing the dream is offering.
Where you are able to be honest to yourself in private but put on ‘an air’ or repress your feelings in public, you can dream about having sex in public. Again the purpose of the dream is the same, but here it is also asking the dreamer to not be afraid of being honest with themselves in front of others.
Another reason for dreaming about having sex is to heal the dreamer of the fact that they are currently not having sex with their partner. In this case the dream attempts to heal stress or whatever impact abstinence is having on the relationship.