Brock Lesnar went to WWE because UFC wouldn't pay him nothing.
According to Dave Meltzer of the Wrestling Observer, Brock Lesnar decided to retire from MMA because Dana White and the UFC did not meet his price point for a fight with Daniel Cormier. With UFC signing a deal with ESPN, their pay-per-view money is now guaranteed, meaning they are less reliant on buyrates and top stars selling more pay-per-views in order to boost revenue.
Lesnar, being a top draw every time he steps into the Octagon, wanted a higher flat fee to make up for potentially losing out on pay-per-view buys. White did not reach Lesnar's price, leading to the fight with Cormier falling through and White saying Lesnar has retired.
UFC had been working on a fight between Lesnar and Cormier since July 2018 when Lesnar shoved Cormier in the middle of the Octagon following Cormier defeating Stipe Miocic to win the UFC Heavyweight Title.
With Lesnar seemingly done with MMA, he has turned his attention back to WWE. Lesnar is set to appear on the June 7 WWE event in Saudi Arabia.