The Church teaches that the use of contraception is intrinsically evil. And intrinsically evil acts are always immoral, regardless of intention. A good intention or dire circumstances does not cause an intrinsically evil act to become moral.
Pope John Paul II: “Consequently, circumstances or intentions can never transform an act, intrinsically evil by virtue of its object, into an act ‘subjectively’ good or defensible as a choice.”
Pope John Paul II, Veritatis Splendor, n. 81.
Pope John Paul II: “No circumstance, no purpose, no law whatsoever can ever make licit an act which is intrinsically illicit, since it is contrary to the Law of God which is written in every human heart, knowable by reason itself, and proclaimed by the Church.”
Pope John Paul II, Evangelium Vitae, n. 62.
Therefore, birth control cannot be used merely because there is a good intention.
The principle of double effect never justifies an intrinsically evil act.