You must have circumaurals. When pads rest against the skull, they can't help but press against the "temples," the long parts that connect the front of the glasses to the ears.
Here's what you're doing. You're putting the helmet on and (unwittingly) brush back. In doing so, you are gripping the temples and pulling them backwards. You probably never noticed that you were doing this.
The solution is to either keep the headphone frames wide enough to clear the lobes (and then release the tension, allowing the cups to come down upon the ears like a helicopter landing) or to remove your glasses before you put your headphones on. If you have Sennheiser headphones, you may be anxious about pulling the frames too wide apart (since doing so can crack the headband). If so, just slip your headphones on, but remove your glasses first, then ease them back on afterwards.
Do what feels more comfortable to you, but keep in mind that you're the one who's doing this. The glasses aren't moving back on their own.