Why in the world would Iran be expected to remain in compliance with the JCPOA after 2018, when Trump tore it up?
As I recall, they did remain in compliance for another year after that, given that it was originally supposed to be a multilateral agreement. But IMHO they should have put everything they had into refinement and weapons production as soon as Trump unilaterally ripped up the agreement. Instead they held back, and they are now seeing the result of that mistake.
None of this would be happening if Iran had actually done what Israel assured us they were doing.
You're asking why wouldn't they pursue nuclear weapons and ballistic missiles to deliver them? Why should they? Don't you think as a country they should have some other priorities? Like ensuring Tehran has water? So because Trump tore up the agreement (and the US was sanctioning them anyways for their ballistic missile program and other reasons) that's somehow justification? Trump tore up the agreement because it would enable them to get there anyways and Iran refused to sign an agreement that would prevent them from getting there.
The JCPOA would have expired in 2025 anyways assuming that they even meant to observe it in the first place.
Your last statement isn't as solid as you think it is. Iran hasn't gotten to a point where they have nuclear weapons mounted on ballistic missiles not because they didn't want to but because they were unable to get to that or were concerned that getting closer would invite the same attack we're seeing today.