I'm mad at my boyfriend for something his friends did
Why would you be mad at your boyfriend if this is something that his friend did?
He was stupid for hanging out with these people in the first place
You should not take your anger out on your boyfriend for something that he did not do. You are wrongly blaming your boyfriend for someone else's behavior.
Don't you mean wrongly blaming his friends for making him do stuff? It's his fault for having shitty taste in friends.
I'm not sure I fully understand what you are saying, but it sounds like you're mad at your boyfriend for hanging out with people who did something stupid.  In that case, I wouldn't be too hard on your boyfriend, but I would still discourage him.  However, if they are enticing your boyfriend into bad behavior, then you are right to be mad at both parties.