Dreaming of having sex with a celebrity reflects your obsession and desire toward that person. You may be attracted to them due to a specific aspect of their personality that your spouse lacks.

Perhaps, the male celebrity is more handsome and masculine than your husband. Or probably, the female celebrity is more fair and independent than your wife. Whatever attracts you to that celebrity may differ from person to person.
Having sex with a celebrity in a dream has the effect of drawing your heart and affection away from your spouse. You become attached to fantasy, and that is why it manifests in your dreams.
This act is sinful, as you are lusting after a stranger. Be realistic and learn to be contented with what you have, because it’s the best.