Why does it feel like my anus hurts when I'm having sex?

Tissue laxity. Assuming you are not having anal sex, the proximity of the vagina along with conditions such as dryness, position, etc... Can contribute to some level of impact on an adjacent structure such as the anus.