The original deal didn't address the core issues. It was just a delay.
https://en.wikipedia.org/wiki/Joint_Comprehensive_Plan_of_Ac...
The relief of sanctions enabled Iran to fund their other activities in Iraq, Lebanon and Yemen. It also enable the regime to invest in other weapons programs including weapons Iran has been supplying to Russia and those it and its proxies are launching against Israel.
I'm not sure Trump withdrawal from that deal was the best idea but the deal wasn't great either.