One explanation in various books (not for certain) is the supposed reason was his team thought they would be pleasing Nixon-—who did not know about it until later.
He had an enemies list and was touchy about anyone trying to do him ill so the crew believed he would be happy if they uncovered what the Dems were doing. Not necessary for Nixon to win, of course.
And the preposterous story of the intrepid investigative
journalist heroes Woodward and Bernstein somehow uncovering this scandal neglects the fact that just like the press versus Trump, they already despised Nixon and looked every hour for anything to make him look bad. Parents were Communists and traitors in the case of Bernstein, teaching their Commie son to hate patriots. Sylvie and Alfred Bernstein, members of the Communist Party since the 1940s and civil rights activists. Total trash.
I never knew that Bernstein’s parents were communists and party members. That explains a lot since Nixon was an effective and energetic commie-fighter.