Well, I'd mention this to your doctor. The rectum/large bowel does run along the entrance to the vagina. A tampon I guess could theoretically be causing pressure and when your feces runs through the rectum, have less room and thus is painful. But I don't know for sure. The above things that the poster mentions can be true but they wouldn't just be active when you are on your period--- it would be all the time. This is just during your period. So, you have to think about what would cause this related to yoru period and I can see how tampons come up. Talk to your doctor.
There could be many reasons behind the pain such as hemorrhoids, polyps or other rectal conditions, but it does sound like proctalgia fugax which is discribed as uncontrolled spasm or contraction of the muscles in the rectal area and pelvis. The cause is unfortunately not known.It's quite common issue and you shouldn't be embarrassed the least!