Lennie was petting the puppy too hard and killed it. He got angry with the puppy, that it died, and he threw it against the wall in the barn.
He was admiring it and petting it because it was soft. Unfortunately, Lennie did not know his own strength and accidentaly killed it. When he realized what he had done, he became angry and threw it against the wall with great frustration.