It is actually legal to accept commissions for fanfic, same as fanart. What isn’t legal, is writing fanfic for a for-profit publication because the money for that would technically belong to the author. But if someone asks you to write a fanfic and they will pay for your time, that’s legal. Morally, though, that’s up to you.

While I understand where you’re coming from, all forms of accepting payment for intellectual property that doesn’t belong to you is illegal. [X][X

Honestly, it does boil down to how you feel about it morally. Ultimately, I/We think it’s wrong to profit off of the works of other people.