The Money to Purchase a Sefer Torah should come from a Clean Source
The money used to commission a sefer torah should not have any doubt of gezel (theft) or come from any other unscrupulous places.
 Lev Chayim 2:167 ois 44 sif katan 15. There it also cites a story of a community that the sefer torah would always be found to have a mistake in it, even after fixing it a different mistake would be found afterwards. The matter was told to the Bal Shem Tov and he said that the torah was written with money from an unscrupulous place and therefore it will never be able to be kosher.