When the spies returned with a derogatory report after scouting Eretz Yisroel, Hashem threatened to wipe out Bnei Yisroel and create a new Jewish nation with Moshe Rabbeinu as its patriarch. Moshe petitioned Hashem, and through a winning argument succeeded in averting the fulfillment of this threat: "The nations that heard Your fame will say, 'Because Hashem lacked the ability to bring this nation into the land that He promised them, He slaughtered them in the desert'" (Bamidbar 14, 16). In other words, wiping out Bnei Yisroel will result in a terrible chillul Hashem. To which Hashem responded, "I have forgiven [them] for the reason you have said."
Rav Wolbe (Shiurei Chumash) cites the Rashbam in Parshas Eikev (9, 25). Before his death, Moshe castigates Bnei Yisroel regarding their transgressions committed while in the desert and the numerous prayers that he offered on their behalf. The Rashbam explains that Moshe was letting them know that they won't always be able to rely on such prayers. Moshe's prayers succeeded because Bnei Yisroel had not yet entered Eretz Yisroel. Therefore, there was always the possibility that the other nations would claim that Hashem lacked the ability to conquer the thirty one kings of the Land, which constituted a chillul Hashem. However, once Hashem would bring them into the Promised Land and systematically destroy the inhabiting nations one after another, no longer would anyone be able to claim that Hashem's ability is lacking. Hence, the current method of praying would be ineffective!
All prayer has to somehow be connected to kiddush Hashem or preventing chillul Hashem. Even when one prays for the speedy recovery of someone who is ill, the intention should be that in this person's present situation he cannot properly serve Hashem, and his recuperation will lead to a greater degree of kiddush Hashem.
We aren't on the spiritual level to ensure that all our prayers are offered with the perfect intentions. Thus, we must pray in every given situation, regardless of the purity of intention. Nevertheless, we should bear in mind that the ultimate purpose behind health, wealth, and tranquility, is to have the ability to serve Hashem without any distractions, thereby glorifying His Name in this world. Often, if we dig deep enough, we will realize that this is the underlying impetus for our prayers. Bringing these thoughts to the forefront while praying, may succeed in making our prayers all the more effective.