Why do you have erections?
So that you can have sex and the species continues. Why do you have them at times you wish you didn't? Going through puberty and you body is adjusting to the changes in hormones and the maturing process. It will settle down after a while and everyone goes through the same thing. For a while, anything can and probably will give you an erection.