From a woman's point of view.. you definitely did the right thing. She sounds selfish and not worth it.
Any decent girlfriend would stick by your side and support you!
My man and I only met a little over a year ago, and we have a 3 month old - so we had to figure **** out fast.. neither of us were ready.. and we're still getting on our feet and broke! haha. but I will never leave him..
And that's what adults do who generally care about one another and want to be together.. you work it out and do the best you can.. appreciate and support each other!
Good luck with the next one

Hopefully you find someone a little more mature!