In Episode 17, "Money for Nothin' and Bits for Free", Malcolm creates a virus that steals money from other people's bank accounts — including Sam and his father. With Sam coming to grips that he might have to sell his precious guitar, his little sister Elizabeth calls him to the laundry chute... and sends him her piggy bank.
Elizabeth: Mom says we all have to help!
There's a handful of moments that show that somewhere in Malcolm there is potential for kindness. He seems touched a few times when Sam tries to offer support and once he grudgingly did his half of a report on family history.