No. Baptism is not contingent on the child’s parents being married, let alone validly.
The baptism could be delayed until a problematic situation is resolved if there does not seem to be a resolve on the part of the parents to raise their child in the faith. Below is a quote from the sacramental norms in our diocese. As with every question, speak to the parish priest rather than taking the answers on this forum as the last word.
"As noted in the Key Policy Statements, in some cases, a Sacrament cannot be given at
the present time, either because of some obstacle such as censure, “after the imposition
or declaration of the penalty” (Cf. CIC, c. 915), or because an individual is “obstinately
persevering in manifest grave sin” (Cf. CIC, c. 915), or because the pastoral judgment
is reached that a person or a family is not yet sufficiently prepared for the sacrament or
committed to the faith. This critical moment can be an occasion for healing and renewal;
or it can become a cause for irreparable separation. Then, the parish priest/administrator
should explain that the Sacrament requested is only delayed until the obstacle is removed or
sufficient preparation is accomplished and evidence of faith is presented. (Cf. CIC, c. 843, c.
868, §1, 2, c. 915, c. 1007).
o Preparation needs to take into consideration the:
- individual needs and prior experience of the person and their family,
- degree of foundational catechesis, and
- current involvement in the faith community."