You're ignoring history. The Iranian government went out of its way to undermine and humiliate Jimmy Carter in the first few years of its existence. Doing the same to Donald Trump would force every subsequent American president to factor in that aggression against Iran led to the political demise of two prior presidents, thus making them more secure. It's perfectly logical, and has nothing to do with whether the Democrats are better or not.
I think it’s a little America-centric to think they’re explicitly invested in the opposition party winning.
Dude, they're at war with America. Of course the internal politics of the country they're at war with are a factor in their strategic calculations. It would be malpractice for it not to be.