Why can't I pee through my erect penis?

Physics. The urethra runs the length of the penis and under the two large tubes that fill with blood when you get an erection. The erection pushes against the pee tube and you can't get enough force to push the tube open to urinate. The prostate also swells and may block the tube so that urine cannot come out. It is simple physics. One is not supposed to be urinating when he is ejaculating. Don't try!
Normal physiology. Your bladder neck contracts reflexly when you have an erection. The purpose is to prevent semen from travelling backwards and up into the bladder when you ejaculate.