Why don't we baptize the unborn?
The short answer
An unborn, unbaptized person is theoretically capable of baptism; the problem is how to apply water safely in the womb. The current Code doesn't forbid it, but the practical difficulty remains.
Capable of baptism
Every unbaptized person, and only such a person, can be baptized (CIC 864). So an unborn child is theoretically capable of baptism.
The practical problem
Water is the proper matter of baptism. Is there a safe way to apply it in the womb?
The law
The 1983 Code does not prohibit baptism in the womb. The 1917 Code said no one should be baptized in the womb while there was hope of baptizing properly after birth. That law is no longer in force, but the practical difficulty remains.