How is getting married the "right thing"?
Getting married for the sake of a kid is never "the right thing". People should get married because they want to spend the rest of their lives together--for whatever reasons--hopefully love being one of them.
God's covenant of marriage always came before having children.. we have a "wedding" as a social event, but the reality is that a marriage begins when the two (male and female) have sex... therefore, the OP is already married in God's eyes.. the marriage ceremony is part of the commitment a man and woman have with each other to show that they are putting each other before their own wants and desires... children who are raised with a maybe daddy or an absent mother have a much more difficult time than a committed set of married parents...