Is a tzedaka allowed to take money from people who earn their money in inappropriate way (say, the person worked on Shabbos, stole, cheated, etc.)
If not, is this a chumra or a halacha?
Please bring sources.
Shulchan Aruch Choshen Mishpat 366:2 says that if someone stole money from an individual and does not know from whom he stole then he should use the money for the public good. Igros Moshe, Choshen Mishpat 1:88, says (in point 2) that one thing he can do is give the money to a mikve. Now, he does say (in point 14) that that should be done in a way that the mikve organization does not know who's donating it; nonetheless, it seems to me likely that if the mikve organization would not be allowed to take the money knowing whence it came then it would not be appropriate to donate it to them even anonymously (fooling them into doing something wrong, taking the money).
Certainly consult your rabbi rather than relying on what you read here, though, for practical guidance.