Ever consider that they might be a sexual thing?
Look, diapers are something that obviously turn you on. Erections just don't "come about" for any old reason (except in those sex-ed videos where kids just get random one's in the middle of class, what the hell was that about?)
Anyway, the fact that you always get an erection when you diaper up shows that they do appeal to you in that manner. It doesn't matter what aspect of the diaper turns you on, the bottom line is that they just do.
With that said, there's no "miracle cure" to prevent erections, no anti-stimulant, and nothing to stop them from coming about when the situation calls for it. I don't think anyone can tell you how to prevent getting them.
If you find they are problematic when getting a diaper on, just relax and think about something else until it goes away. Or eventually, when you wear diapers for long enough, the appeal of them really dies off and ultimately means they don't really turn you on much in the first place. The only solution is time.
God, I'd hate having to be a teacher and explaining this stuff to kids.