When I workout I get erections. I'm just working out. Why?
Erections are caused by a muscle in your groin clamping down on the vein that drains your penis. This causes the blood to back up and inflate your penis. When you are working out, you are tensing your muscles and it is common to tense more muscles than you realize. Add to this that a workout gets your heart pumping, which means the penis inflates quicker. Erection strength also varies with position of the body, though it depends on the person, but it some positions you are able to maintain higher blood pressure. Then there is the fact that once it starts even a little bit, you notice and that just makes it stronger. All of this just says, that it is common for guys to get partial or full erections while working out.
Look into getting some athletic underwear. These usually have some spandex in the material to keep your genitals closer to the body. They also are vented better to keep you drier while working out. It won't stop the erections, but they will be less noticeable.