The thing is to not use a lower threshold for being absent from Mass than you would for another activity of similar length and with similar physical requirements that you wanted to attend or felt a duty to attend, like school during exam week or even the wedding of a friend. Having said that, if the pain would keep you home from school or an event you have been looking forward to, one should not feel remiss in also allowing it to keep you home from Mass.
That is when the problem is not communicable. When you have a disease that is communicable, STAY HOME! At the very least, be scrupulous about washing your hands when you come in and keeping your hands away from your face during Mass, so that you can extend the sign of peace safely. Also, do not partake of the Precious Blood, please. The chalice does not kill viruses and bacteria.
When our kids were little, they used to pick up some nasty and long-lasting colds at school. I used to bring a little squeeze bottle of that waterless hand soap to Mass and had them apply it right after the Our Father.
A man is of course entitled to an opinion on a theoretical level concerning considerations that women face. Pope Benedict, wise man that he is, never tried to tell us how bad menstrual pain is. I have six brothers, but I wouldn’t presume to tell you how bad it is for you to be kicked in the testicles. Nevertheless, I think you can imagine a persistent and severe cramping of your involuntary abdominal muscles, such that straightening up for any period of time is very difficult. Have some compassion, here!
I know people who pride themselves on dragging themselves to work no matter what, regardles of whether they are any good to themselves or anybody else. That does not make the theoretical threshold for calling in sick to work a matter of whether or not you are physically able to drag yourself in.
Menstrual cramps certainly may rise to a level where the woman is temporarily incapacitated. As there are women who have experienced both who compare their worst menstrual pains with labor pains and have not found a huge amount of difference, I’m inclined to take them at their word for that.