Did your child tell you this? I'm sorry that you have to deal with this situation. It sounds like your boyfriend has crossed a line and I can imagine how upset you are.
You need to put your foot down and set a boundary with your boyfriend immediately. There is no room for rationalization when a child's wellbeing is on the line.