Iran knows that it doesn't have negotiating chips like North Korea, they don't have their enriched Uranium anymore -- which was given up after the Iran deal. The only way they think they can get anything is by annoying the US here and there and hoping that at one point they give in and stop the sanctions.
They're literally using the playbook of North Korea, without nuclear weapons.
Not an expert, but I've been under the impression things are pretty much opposite of what you say. I think Iran would be a much bigger issue than NK.
Iran is in the middle east, and they are military allies with Russia, Iraq, and Syria. They have a decent modern Airforce and Navy. We already have a ton of troops exposed in the area dealing with other issues. Going to war with them would likely mean years long war with a possibility of serious escalations with Russia and the best case scenario is it ends up the same way Iraq did.
We already have North Korea Surrounded and I don't think China or Russia would offer them much assistance. (I could be wrong, and it would also depend how exactly things escalated) If they are lucky enough to get a nuke up in the air (it would take some luck considering they are pretty limited on where they can launch them from, they'd probably be hit with a NATO Nuke from a Sub or Plane before their nuke even landed. It wouldn't really be a war, just a bunch of innocent people quickly dying.
I could be totally wrong about a lot of that. Just recalling some wikipedia rabbit holes I've been down.
China backed NK in the Korean war, and would probably back NK if the US unilaterally used military force against NK. If NK were to get working nukes they can reliably launch several hundred miles, they could force the US (and allies) to remove their military presence from the region (they have allies to the North and West, and there is water to the East and South).
Iran has allies, but they are geographically separated from Iran, and Iran is surrounded by either water or its enemies. This makes it more difficult for Iran's allies to help it in a possible war that it's allies do not want to be directly involved in (these types of wars are generally fought via proxy).
Loosing the ability to have a military presence near the NK region in the Pacific could mean we cannot trade with countries in the region on favorable terms. If Iran were to force the US out of the region, the amount of trade affected would be much less.