Q. We are a product of the environment that we take birth and grow up in. To a great extent this environment determines whether one will be religious or not. If God is in control of this, then why should one have to suffer the consequences of being born in an atheistic family?
That God is the ultimate controller does not imply that God is responsible for all our actions. Every individual is responsible for his/her own actions. We make our own destiny based on our desires and past actions, but that happens under the direction and sanction of God. If one is born in atheistic family, it is a result awarded in accordance with their own desires and past misdeeds.
God's ultimate control does not exempt us from bearing the responsibility to act in accord with His will and according to the codes of theistic conduct.
However, although our natures are greatly molded by the environment as you have described, even in the most unfortunate of circumstances one still has one's freewill and one could take that very situation as an impetus to take shelter of God. A person coming from unfortunate circumstances from birth may be inspired by God Himself, from within his heart, assisting him to understand God. The classic example is that of Prahlada Maharaja who, although was born as the son of the most formidable demon, became an exalted devotee by the association of Srila Narada Muni.