Edit: I also don't think he's necesarily a racist of bigot but he says ignorant racist and bigot bits for comedy. It just doesn't work for him when there isn't a joke there.
This is really tangential to Louis, but anyway: I do believe there's a line here, but I think it's a lot thinner than people think. Comedy is ultimately a tool; it has no moral values of its own, but it can be used destructively or constructively. It can punch up if that's what the people using it want it to do, and it can just as easily (if not more easily) punch down.
If someone wants to use bigotry in their comedy in order to fight bigotry, that's something you can do, but you need to take pains to ensure that's what you're doing. You have to be aware that the audience might not know who you meant to aim it at, or might not understand the lesson, and so you have to craft your jokes in a way that reduces the chances of that happening. If it still doesn't land the way you want it to, you have to admit that it's on you, and then you have to either totally rework it or scrap it.
But whether it goes well or not, you're still profiting off bigotry. If it's vital to your humour and you're selling your humour, then it's part of how you get your money. I don't think that's innately bad, but it's something to be aware of. If you're trying to turn bigotry on its head in order to attack it, maybe we could agree that's something that's worth being paid for. But if you simply want to get paid or enjoy using bigotry for humour, packaging it as if it's helpful instead of harmful might just be a convenient for you to get the results you want.
There's an old Bill Maher panel that always sticks with me where Sarah Silverman was criticized for using a slur against the Chinese as a joke. Her argument was that she was fighting racism. In the panel, Bill and Sarah basically use this logic to should down the non-white members of the panel, including the Chinese guy. There's a moment where Bill repeats the N-word at the black panelist to demonstrate that he's allowed to say it because the setting is appropriate. When he got flack for using the N-word more recently and had Ice Cube as a guest, you can hear him try the "but I'm fighting racism" defense before Ice Cube then shuts him down.
If you decide that you're going to use your platform and try to defend people, that sounds good. But what do you do if they say "stop"? Do you stop and listen to what they have to say, or do you say "shut up and let me help you"?