I hate to say this, but he's probably cheating on you. He probably can't get it up for you because he's been having sex with other girls. Doesn't mean you're unnattractive (quite the opposite I'd say). He's just, unfortunately for you, found another interest.

Hate to be blunt, but I call it how I see it. =\