I second the notion it is could be from performance anxiety. Are you anxious, when trying to have sex?
Hi Sam, A penis that cant get hard enough for penetration is suffering from ED erecile dysfunction, there are drugs for this Viagra and its two friends, they all do the same thing, they relax the vessels in the penis to allow more blood in for you to have an erect penis, they take about an hour to work, but they can have some bad side effects on the odd person, or may just not work.
But ED can be a precuser for heart problem, you could be suffering from anxiety when you go to have sex, this could be a problem from masturbation, as what is done by the hand is remembered by the brain, and if your masturbating to porn then you have a bigger problem, its called porn enduced ED, were do you fit in with what I have said in this last peice.
Please come back.