Let's discuss the situation where the team did not create the defect in the first place. Maybe the team inherited a system that was full of technical debt. The answer here is easy, the team should get story points for that.
But if the team is responsible for the defect? If they can't apply any story points for the fix then how do they identify the work and plan accordingly? On the flip side, if they are apply story points then aren't they receiving the points twice?
What if teams estimated the fix in terms of story points? Then they could plan accordingly just as if it was another user story. However, let's say the story points didn't count towards their achieved velocity. In a way the team is being punished because they're doing work which they're not getting credit for. But maybe that's incentive NOT to inject defects in the first place.