The answer is simple. He loses his erection or cannot get one because he has been drinking too much. A few men can perform even when they are drunk, but your BF is not one of them. His blaming you is typical behaviour for some guys as he wants to avoid the real reason for his erection problems, which is his drinking.
You probably would like to help him. Unfortunately, if you bring up the drinking he will probably just get angry at you and start blaming you all over again. I can hear his words, “Oh, now you want to take away the fun of having a couple of beers, you little _____[fill in the blank]”
The only blame you have to assume for yourself is staying with him after learning what I just told you. Then you are enabling his drinking and he never will get better.