One reason why squashing moths is a bad idea is that they can stain the surface they are on, especially if it's drywall. Scrubbing the stain after the matter usually makes the stain worse.
Instead of squashing moths a preferred method it to use an electric fly swatter and zap them in flight.
When moths are on the wall they have a tendency to fall/jump downwards. With this knowledge one takes the swatter while being live (active) and slowly travel upwards until one barely touches the moth. In the best case the moth will jump down and get instantly zapped. In the case it flies away, the racket is in the position to quickly flick the wrist and zap it in mid flight.
In the ideal situation moths should have never nested inside and one can question what is the lesser evil: throwing away food and/or fabrics because they are infested with pests or zapping moths.