The Redemptorist Father Ferreol Girardey offers two reasons to explain why some prayers go unanswered as asked. The first has to do with the worthiness of the petitioner; the second, with the suitability of the petition.
As for the first reason, Father Girardey says: “The prayers of some are not granted, because these persons are unworthy, unfit to be heard, on account of the hindrance they themselves place in the way, according to the prophet: ‘Thou hast set a cloud before thee, that thy prayer may not pass through’ (Lam 3:44). That cloud is sin, mortal sin. The hardened, obstinate sinner who has no wish, no sincere desire to give up sin, is wholly undeserving of being heard by God, for he wilfully remains in sin, is a wilful enemy of God and has the intention, the will to continue in His enmity, in his sin. To such a sinner we may apply the saying of the man born blind, who had received his sight from Jesus: ‘God heareth not sinners’ (Jn 9:31).”
“But as to the sinner who grieves over his sad state, and has, at least, the desire to give up sin and change his life, though he may be deterred from doing so on account of the great sacrifices this would require, he has some claims to be heard. Such a one should, before all else, pray God to impart to him the necessary courage and strength to give up sin.”
“As to the sinner who is fully determined to do all in his power to amend his life, and prays God for the grace and strength to do so, God will, most assuredly grant his prayer and help him to do all that is required to recover His friendship and to lead henceforth a good and virtuous life, and will forgive him all his sins, however heinous and numerous they may be.”
“But as to the sinner who does not detest his sin and has neither the will nor the desire to amend his life, the object of his prayer will be some temporal favor or advantage, which, if granted to him, would most probably enable him only the more to offend God and gratify his own passions by committing more sins. He, therefore, does not deserve to be heard.”
Thus, “if our prayers are not heard, not granted by God, the fault is not God’s, but ours.”
Quotations from Ferreol Girardey, Prayer: Its Necessity, Its Power, Its Conditions (St. Louis: B. Herder, 1916).