There are several statements of Rambam that appear to conflict about this.
In Hilchot Ishut 15:2 he writes that women are exempt from the commandment of having children:
האיש מצווה על פריה ורביה אבל לא האשה
The mitzvah of being fruitful and multiplying is incumbent on the
husband and not on his wife. (Chabad.org)
In Hilchot Ishut 15:10 he says that even though women are not obligated to have kids they still need kids for their old age:
אע"פ שאינה מצווה על פריה ורביה צריכה היא לבנים לזקנותה
Although she is not commanded to fulfill the mitzvah of being fruitful
and multiplying, she needs sons [to assist] her in her old age.
In Hilchot Ishut 15:16 he states that women should not remain unmarried:
ולא תשב אשה בלא איש שלא תחשד
Similarly, a woman should not live without a man, so that she will
not be suspected [of immoral conduct]. (Chabad.org)
In Hilchot Issurei Biah 21:26, however, he states explicitly that women need not ever get married:
ורשות לאשה שלא תנשא לעולם או תנשא לסריס
A woman is permitted not to marry at all or to marry a eunuch.
The ruling that women must get married is left out in both the Tur and the Shulchan Aruch, but R. Moshe Isserles adds it in his gloss to E.H. 1:13 as a "some say":
ומ"מ י"א דלא תעמוד בלא איש משום חשדא
Nevertheless, some say that she should not remain without a man, on
account of "suspicion".
This is codified in the Levush E.H. 1:14 in the same way:
מכל מקום יש אומרים שגם היא לא תעמוד בלא איש משום חשדא
Nevertheless, some say that she too should not remain without a man,
on account of "suspicion".
However, various resolutions to the contradictory sources have been proposed by later authorities. Some simple famous ones are:
- A woman does not have any Biblical obligation to get married or have kids, but the Sages decreed that she must. When Rambam permits remaining unmarried he is dealing with the Biblical level.
- The obligation to get married is only to prevent suspicion; it is not an inherent obligation. When Rambam permits remaining unmarried he is referring only to inherent obligations.
- The obligation to get married is only to prevent suspicion; therefore, in a situation where there would be no suspicion (e.g. she lives in her father's house, or there are no men around) she can remain unmarried.
- Women are not obligated to get married but it is recommended in order to prevent suspicion.
This is probably best summed up in the words of the Aruch Hashulchan E.H. 1:3 where he writes:
אמנם הכל לפי הענין
However, everything is [determined] by the situation.