While it will probably turn out to be true that The Machine caused Peter's behavior given the nose bleed and the writer's intent by introducing the idea, that was just speculation on Walter's part, and nothing Peter did in the episode seemed completely without precedent or understandable motive to me.
He's already impulsive and quick to kill the shapeshifters given his actions with the one Fauxlivia held "hostage" in 'Entrada.' What if that had really been the innocent mother and she was just too frightened to answer his question about her daughter's name before he shot her in the head? Even if the odds were heavily in favor of it being the shapeshifter, he took a huge and unacceptable (by FBI standards) risk in taking the headshot there, and did it without consultation with Broyles or warning to the shapeshifter and Fauxlivia that he knew the truth so they might as well surrender.
The length of time between visiting The Machine and the start of the shapeshifter killings is unclear despite the scene with Peter sneaking back into his and Walter's house immediately following the other. Walter had read the First People's book "dozens of times" searching for answers but he could have already started doing that beforehand, and knowing Walter he could probable plow through a book like that in no time. Also, they were still worried about Peter's nosebleed recurring, so it left me with the impression it was within a couple of days at most. It's therefore entirely possible Peter had decrypted Fauxlivia's "Olive" code and was keeping it to himself (because he intended to kill the shapeshifters) before ever visiting The Machine, since we know he was working on decrypting the laptop anyway, he was just limiting what he gave to Fringe Division.
As far as Peter's motivation goes, Fauxlivia with the assistance of the shapeshifters profoundly wounded Peter psychologically. While he's good at covering it up with most people, you can see it in his hesitation with having Olivia read the decrypted files and see him at his most vulnerable, and by his own description, "foolish." While he's been the con many times before, he's never been the mark, and never in such an incredibly personal way. He's deeply ashamed of himself, and has to eliminate whatever vestiges of what caused that shame that he still can exert control over, namely the shapeshifters still residing in his universe.
If I had any complaints about this episode it would be that it seemed completely obvious to me that Peter was the one doing the killing right from the start, and that the unsubtle misdirect with Dr. "I'm listening intently to your conversation with an evil expression on my face" was a bit ham-fisted and soap-operish. That being said, the psychological drama, the gradual rebuilding of the Peter/Olivia relationship and trust, the cool and freaky powering up of The Machine, the continuation of the mythology arc, and as always John Noble's outstanding balance between dramatic and comedic elements of his performance (the "I've snorted worse" and chimp behavior bits were hilarious) made this episode worthy of an "excellent" grade for me.