In Hinduism there are cases where astrologers or pandits ask devotees to chant certain mantras or do fasting on specific days. Why doesn't God give what we want directly (without doing anything) as we are God's children?
This Question can never have to the point answer, Going in depth in this issue will put different view and idea.I will like to answer on my perception of GOD.
As you had mentioned
we are god's children.
suppose a person have 100 rightfull heir (sons) to his Property, But his dilemma is to whom he should give his house ( suppose he cant give his House to all his 100 son), Now to decide he need some parameters to decide whom to transfer his House.
considering the above example as situation of God.
everyone can't have everything,if any body plans to have a thing which is not common to everyone he need to show his strong desire and ability to have that thing.
As we know all material thing in this world doesn't apply to real self (The Soul),So we need to show our will power by showing our strong hold on soul,which is not affected by the materialistic nature of world. These were the reason Sadhus ,Rishi muni,Warriors earlier perform Asceticism or Mortification of the flesh, to get pleasure for soul.
But things had eventually changed ,earlier penance was done for soul,eg people used to ask for Moksha, Divine knowledge which were attributes of soul.
but these days we ask everything (mostly materialistic things) from God. like, Promotion,Passing exam etc etc.
please do edit this answer, if you think anything is wrongly written