The drones and missiles helped them to not lose the war, but they were significantly damaged by the initial strikes. A nuclear capability might have been sufficient deterrent to prevent those.
Too many people looked at Gaddafi's fall and Kim's endurance and made a short generalization "it pays to have nukes". But there is nuance in that contrast - if Libya was a friend of China and directly bordered it, no one would dare attack it the way it was attacked, nukes or not.
Iran's largest leverage is in controlling Hormuz and threatening Dubai, Qatar etc. with destruction of their oil and water infrastructure. All of this can be done cheaply with conventional weapons. If they ever use nukes, though, they can expect to be nuked in response.