There is an African superstition to the effect that acquiring a baby carrying blanket before a baby is born leads to bad omen. As such baby clothes were acquired only once the child was born. This superstition led to the realisation by our ancestors that resources and efforts should not be spent unless one has overall control on the outcome of the project.
There are some situations that we cannot control and the outcomes can only be decided by fate, hence spending resources on an uncertain outcome could very well be wasteful. People should instead spend resources on the things whose outcomes they can control or are certain of. The proverb is not to be taken literally but rather in its allegorical meaning.