The Gretchen backstory was early on, like the first two seasons. Gretchen was his lab assistant in college, and they were involved romantically. They had a flashback where they were in a lab and applying exact percentages of the makeup of the human body and came up a fraction of a percent short. She suggested it was the soul and Walt poo-pooed it. How the romance ended is unclear. But she ended up with Elliott. He's always been bitter that he sold his stake in Gray Matter early for like $5000 and then it exploded into a mega-company. He has misplaced anger toward Elliott and Gretchen over missing out on the fame and fortune and possibly some lingering feelings for Gretchen too. He's always "blamed" them for missing the boat with Gray Matter. It may be that he sold out so early to get away from the pain of seeing Gretchen with Elliott, but I don't know that for sure. That might add to his anger over the whole scenario.