“Hogan may be a liberal Republican but if you’re a Dem, why lie and say you’re a Republican in Maryland?”
For the same reason that Michael Bloomberg ran as Republican in New York. He would have lost in the Democrat primary to a candidate who was even more left-wing than himself.
Note: Bloomberg, a lifelong member of the Democratic Party, decided to run for mayor as a member of the Republican Party ticket.