It was cheaper, I don't think it's much more complex than that. And with fossil fuels, countries without significant local production are always dependent on someone else, with most potential suppliers being problematic in some way.
Of course we should have gone for renewable energy more forcefully, but that wouldn't have resolved the issue. That change will take time, and you can't arbitrarily accelerate it.