First of all you need to stop being so hard on yourself. It is obvious that your problem is not physical since you do have erections. Therefore, I would guess that all of your problems are related to a psychological issue, and stress from worrying about your performance.
My advice to you is to make an appointment with a psychiatrist and/or psychologist and openly talk to him/her about all the issues you are having both physically and mentally. Much of this may be caused by your thoughts and internal battle as to whether or not you are straight, bi-sexual, or gay.
Sorry I couldn't give you a more definitive answer, but this is something that a professional counselor and/or medical doctor needs to help you with. Good luck, and hope you are able to get some help soon.