would it be better to do a PhD as soon as possible to prevent family weighing you down, or to become financially independent first?
Ideally, both - but in STEM you would get a stipend that you could live off of if you had no children so if you could only do one or the other I would say the first.