My male colleague can leave for back pain but I can’t leave for period pain

I definitely go to work when I have my period, even though I get terrible cramps. I go through a bottle of pain killers every period. But my period came early while I was at work and I was not prepared with any painkillers. My male boss told me I can’t leave for “woman problems” but just a week ago he let a guy leave for back pain. Is this okay? Am I in the wrong for wanting to leave early?