We are commanded to have children. The nuance here is “…if you should marry”. Nobody can be forced to marry, however, if you do, unless there is some extremely compelling reason, you must make the effort to have at least one. It is debatable whether two spouses who go into marriage with the deliberate intention never to have children, with no other reason than “we just don’t want to”, can even contract a valid marriage. (It’s a ground for declaration of nullity — what does that tell you?) People who know they are infertile before marriage are not bound to this, as none of us can do the impossible. This would apply to, among others, any later-in-life marriages where the wife has gone through menopause. Surgeries where involuntary sterility is the result (ovaries removed, hysterectomy, etc.) will also make this intention impossible. (Yes, I know, that is just stating the obvious, but I wish to clarify the discussion.)
We have no commandment to marry, and in all honesty, that is something that puzzles me. Yet the commandment does not exist, and it did not even exist under the Abrahamic covenant. One wonders what the faith of Judaism and Christianity would have looked like, if there had been an “eleventh commandment” — “thou shalt each one of you marry, and unless nature provides otherwise, thou shalt bring forth children”. Interesting to contemplate a taste of “alternative salvation history”.