J.W.
Sorry, S., this is totally normal. My son started developing erections around the same age and they were always related to him having or about to have a BM. I'm going to go out on a limb and suggest that the erections aren't so much "bothering" your son as they are "fascinating" him. Don't worry--he'll get over this phase in about 85 years.