The cost isn't just about things money can compensate. A new mother on maternity leave (or father on paternity leave for that matter) is:
* Not undergoing training (if applicable, eg: a new hire).
* Not gaining and maintaining experience and knowledge in the field.
* Not making business connections with others in the industry and elsewhere.
* Not keeping up (in regards to new standards and ways of doing) with her workplace and the industry at large; IT industries especially so.
* Not providing her manpower, which must be compensated by another employee(s) who can't just be fired or transferred away when (or if) she returns.
Basically, the overhead of accomodating and compensating for employees that maek babby is simply unacceptable for many businesses, especially the smaller ones and particularly if the babby is had very early in their employment or career.
You might say this is sexism and discrimination (even though it's not; childbirth is a choice to be made), but this is the cold harsh reality. People who agree to be employed are expected to work, not maek babby.
This is also a reason for falling birthrates: More people just want to live and work without the sacrifices demanded by childbirth and rearing. They know their life or career they have or dream of could end right there if they choose to have children.