In Egypt a case was discussed about donations from unsavory sources. In the end Moreinu Shim'on ruled that they could accept donations even for sifrei torot as long as you remove potential stumbling blocks from the donations, such as not allowing names to be inscribed on objects that may remind others of their sins.
"R. Raphael Aaron ben Shimon, Nehar ...
R Shimon Taub in The laws of tzedakah and maaser addresses your first question
If a Jew who deliberately transgresses major mitzvot (e.g., Shabbos)
wants to give tzedakah to poor people, one may accept his donation.
It is questionable if tzedakah may be accepted from such a Jew for a
shul but it has become a custom to do so for a shul or yeshiva.
Based on ...
The question is whether the original item must be "expunged" as-is, or whether simply the value has to be paid back. So the thief isn't gaining either way!
As you suggested -- yes, if you modified the item, you keep the item, but instead have to pay back more. The dialogue in the TV show is saying that it still doesn't seem fair that this item per ...