I think you might be needing to question your sexual orientat1on....Not a big deal. It is hardest to admit your sexual preference to yourself. YOu might be bi. It takes a lot of courage to 'come out' even to yourself....i just figered out that i am bi, and still won't admit it to my friends and I am in a very open enviorement where half of my friends are bi or homosexual. So yes it is possible u just haven't admited it yourself even if do not see a problem with homosexuality.
i think a lot of people have the same problem you do. i can be doing cardio and all of a sudden i get an erection! and i have to stop. i get erections in the locker room, shower, grocery store, gas station, etc. it's just natural! some of us just have more hormones flowing than other guys. i wouldn't recommend jacking off before the gym though, i find that i have less strength. what is better than having a hard sweaty workout to get the testosterone flowing and then masturbating in the shower? don't worry about it!!
This happens to me once in awhile. In fact, I get hard ons everywhere. What I like to do is think of a non-sexual song. Focus on a point right between your eyes, and stand not facing people until it goes away. This just happens to some young guys.
Such things happen to everyone (well, males, of course). It doesn't mean you're bi or gay or anything you don't want to be. The average man gets an erection 11 times a day, randomly, for no reason. Yes I said 11. Males, in the cave people days, did the hibbidy dibbidy all day long, or whenever they felt the urge. Males of this day in age are just damned horny all the time because of it. Don't worry about it. It also tends to happen less when you are more sexually active.