I reply that it should be said that matrimony, from the intention of nature, is ordered to the education of the children, not for a certain time only, but rather for the entire life of the children (which is the reason why, by the law of nature, parents are to lay up wealth for their children, and children should inherit from their parents). For that reason, since children are a common good of husband and wife, it is necessary according to the dictum of the law of nature that that association remain perpetually undivided. Thus, the inseparability of matrimony is based on the law of nature.—Super Sent., lib. 4 d. 33 q. 2 a. 1 co.
This puts a somewhat different twist on the phrase 'educating children'; Aquinas sees it not as (merely) teaching little tykes, but as a much larger project of making sure the next generation has the counsel and resources they need throughout their lives. Education of one's children takes different forms, sometimes very different forms, depending on the age of one's children and the stage of one's own life, but it is a responsibility as enduring as the parent-child bond itself. In a sense it is even more so: by foresight we can guide and provide for others long after we are gone, laying up wealth both by teaching and by material inheritance.