Iran is a huge mountainous country, they have everything they need for industry right on their own land. In their case it's purely about competence whether they have a nuclear weapon or not. Whether they have rockets or not. Certainly ballistic rockets.
They also have 95 million people, which is certainly enough to do it. They have inherited/stolen somewhat functional infrastructure (ie. schools, universities, research labs, ...) from the Shah.
Additionally they absolutely do not care about the consequences for the Iranian people. By that I mean once a ballistic rocket's motor goes out, at the top of it's trajectory it is more or less unstoppable (it just falls down essentially). Which means fighting ballistic rockets can only happen above (at the very least close to) the launch site, which means in Iran, and that means above the heads of ordinary Iranians. And of course what works best is disabling them on the ground.
They're not competent enough to build things themselves ... yet. Neither Shaheds nor the ballistic rockets, and certainly not things like centrifuges. But China and Russia are helping them out with a bunch of components. So there you are. Again, China and Russia know perfectly well that this can only end in war against the Iranian people, and yet they still do this.
Btw: yes Hamas' and Hezbollah rockets are ballistic missiles too and suffer from this problem. But they're ... shall we say "tactically using" the problem, blaming the target for the inevitable deaths. The only way for Israel to defend itself against those rockets is to make them impact Gaza/Lebanon instead (if you hit them on the ascent you're essentially massively reducing the range of the rocket). But of course they're pretty small compared to what Iran is firing.
Now, of course Iran COULD build these rockets like the west does: so that when they're intercepted they don't kill. To have an active fuse system and you only activate the fuse near the target. Then, if anything happens you still have the rocket impact, but not the explosion, no or minimal shrapnel, etc. But no, they make their weapons like the Soviets did. These weapons are meant to kill in all cases. If they get intercepted, if they have an accident, if the maps aren't up to date, they just kill anyone they can where they fall and if they fail entirely they kill the launch crew. These weapons are designed for maximum killing, whether it's their target or someone else, and then they blame the resulting deaths on the target.
Of course in an honest/sane system such deaths would be blamed on the manufacturer of the weapons, but apparently we're not intelligent enough for that to happen.
It is worrying that Iran itself is now also using human shield tactics with their own people. That girls' school that was hit in Iran ... was an IRGC base until 3 years ago. The school is surrounded on 3 sides (about ~half) by the IRGC base, and the road into that school is the road into the base. The school is inside the outer wall of the base. In other words: this was specifically arranged by the Iranian government to try to get a foreign adversary to hit the school. Luckily they've also totally failed to show even a single corpse and the school was hit at a time the building should have been empty. So hopefully, this is just a lie.
But if true, this incident is 3 years of 100% intentional human rights violation by Iran's government, and one miscalculation on the US or Israeli side, or perhaps even a screwed up missile launch by the IRGC. And let's just not consider the possibility that they boobytrapped the school on purpose (it just happens to be an area where a minority lives ...)