The objection runs as follows:
1. If God issues a commandment and means it literally then God himself must keep that commandment.
2. God does not answer every prayer.
3. Therefore, since God himself does not give to everyone that asks him then he didn't mean the commandment literally.
4. Therefore, men are justified before God in literally breaking God's commandment to give to everyone that asks them to.
Point 1 - the principal claim upon which the rest of the argument depends - is exactly contradicted by D&C 64:10: "I, the Lord, will forgive whom I will forgive, but of you it is required to forgive all men." Here, God issues a commandment and makes it quite clear he means it literally, while explicitly stating that he himself will do according to his will. There are other examples which illustrate this point (say, "thou shalt not kill" while he destroys cities; or "judge not" while he standeth to judge the world, &c.), but this suffices to directly refute the principal claim of the objection on scriptural grounds.
The objection is false in principle.
But more interesting is the "fact" that the false principle was intended to weaponize against God's commandments - the claim that God does not answer every prayer. To the disciples whom he had commissioned to go forth into the world teaching the people, Jesus said: "Say unto them, Ask of God; ask, and it shall be given you; seek, and ye shall find; knock, and it shall be opened unto you. For everyone that asketh, receiveth; and he that seeketh, findeth; and unto him that knocketh, it shall be opened" (JST Matthew 7:12-13).
Was Jesus lying? If they asked of God, would they receive? Yes, if they believed. Those to whom the disciples said these words, if they believed the disciples, could ask and be answered.
Belief is always the necessary precondition. When Jesus went forth performing miracles, he would commonly ask - do you believe I can do this? Where belief was lacking, he could not grant their requests.
"Behold, I say unto you that whoso believeth in Christ, doubting nothing, whatsoever he shall ask the Father in the name of Christ it shall be granted him; and this promise is unto all, even unto the ends of the earth" (Mormon 9:21).
I cannot say that I have ever believed God would grant my request and God did not grant it. When I have asked this question of others - have you ever truly believed God would grant your prayer, and God not grant it? - the answer has been uniformly "no."
What would your answer be?
The next interesting aspect is to inquire - how can I believe? How can I believe God will answer my prayer?
"Now we know that God heareth not sinners; but if any man be a worshipper of God, and doeth his will, him he heareth" (JST John 9:31).
And, cutting straight to the punchline...
JST 1 John 3
14 We know that we have passed from death unto life, because we love the brethren. He that loveth not his brother abideth in death.
15 Whosoever hateth his brother is a murderer; and ye know that no murderer hath eternal life abiding in him.
16 Hereby perceive we the love of Christ, because he laid down his life for us; and we ought to lay down our lives for the brethren.
17 But whoso hath this world's good, and seeth his brother have need, and shutteth up his bowels of compassion from him, how dwelleth the love of God in him?
18 My little children, let us not love in word, neither in tongue only; but in deed and in truth.
19 And hereby we know that we are of the truth, and shall assure our hearts before him.
20 For if our heart condemn us, God is greater than our heart, and knoweth all things.
21 Beloved, if our heart condemn us not, then we have confidence toward God.
22 And whatsoever we ask, we receive of him, because we keep his commandments, and do those things that are pleasing in his sight.
23 And this is his commandment, That we should believe on the name of his Son Jesus Christ, and love one another, as he gave us commandment.
24 And he that keepeth his commandments dwelleth in him, and he in him. And hereby we know that he abideth in us, by the Spirit which he hath given us.
Loving one another entails "giving to every man that asketh," as Christ commanded. Why not simply believe that he means it, just as a little child believes his father? And if you serve him as a faithful son serves his father, will he not grant you according to his word?
To quote Joseph - "I believe all that God ever revealed, and I never hear of a man being damned for believing too much; but they are damned for unbelief."