Sometimes God says No.
James explains why.
James 4:3 (AMP)
You ask [God for something] and do not receive it, because you ask with wrong motives [out of selfishness or with an unrighteous agenda].
Check your motives when you pray. God will check them when he answers.