The English word patriot comes from the Latin patriota - "countryman", which comes from the Greek root πατρίς (patris) - "fatherland". Here is the really interesting part of that linguistic reminder: in the 18th century when this word came into usage in English, loyalty to the State was seem primarily in contrast to loyalty to the Church. It was even argued by some that clergy not be be allowed to teach in public schools: since their true patrie was in heaven, they could not inspire adequate love of the homeland in their students.
Unless our faith has been completely co-opted by the dominant culture, there is always an inherent tension for followers of Jesus who rightly love their country but always penultimately, not ultimately. Since our true patrie is indeed in heaven, the order always matters: God, then country. There is a Biblical name for religion that confuses that order and wraps itself in the flag: it is called idolatry.
I love the litany below (which comes from The Book of Common Prayer) because it embraces this inherent tension and reminds us that while we do rightly give thanks for so many blessings in a great nation, we are also brought to our knees and reminded of the work that remains before us. As we approach the celebration of the Fourth, we thank God for the beauty of the land and its many resources, for example, and yet are caught short in being reminded that these gifts are given for more than profit, and that we have been called to be much better stewards of this good earth. We pray - all of us on the right and in the middle and on the left - for healing, forgiveness, inspiration, enlightenment, and renewal. We recognize the work that remains, until there is truly liberty and justice for all.
Almighty God, giver of all good things; We thank you for the natural majesty and beauty of this land. They restore us, though we often destroy them.
We thank you for the great resources of this nation. They make us rich, though we often exploit them.
We thank you for the men and women who have made this country strong. They are models for us, though we often fall short of them.
We thank you for the torch of liberty which has been lit in this land. It has drawn people from every nation, though we have often hidden from its light.
We thank you for the faith we have inherited in all its rich variety. It sustains our life, though we have been faithless again and again.
Help us, O Lord, to finish the good work here begun. Strengthen our efforts to blot out ignorance and prejudice, and to abolish poverty and crime. And hasten the day when all our people, with many voices in one united chorus, will glorify your holy Name. Amen.