Abram provides us with a model for loving God and people for their own sake and not for any manifestation of that love.
Provided by KOLEL--The Adult Centre for Liberal Jewish Learning, which is affiliated with Canada's Reform movement.
The first two parashot of Genesis tell the story of the creation of the world; with this, the third parashah, the story shifts to the beginnings of the Jewish people. Abram and Sarai (later to become Abraham and Sarah) travel from their home in the East, to Canaan in the west, then to Egypt and back to Canaan, having adventures and conflicts along the way. God strikes a dramatic and mystical covenant with Abram to give him land and descendants, and changes his name. Finally, (now) Abraham has a son with Hagar, the Egyptian maidservant; this causes family tensions.
"Abram passed through the land as far as the site of Shehem, to the oak of Moreh...God appeared to Abram and said, 'To your descendants I will give this land"--then he built an altar there to God Who had appeared to him. " (Genesis 12:6-7)
At the beginning of Abram's travels, he arrives in Canaan (what the land of Israel is called at this point in time) with his family and possessions, and again encounters the mysterious God who commanded him to leave his home and come to this foreign land. When God first appeared to Abram, in 12:1, God promised Abram to make of Abram a "great nation." Only now, in his second encounter with the Divine, is this blessing connected to a specific land.
The Torah often uses very compact language to tell its narratives. In this case, we have a whole story in just two verses. Abram has traveled across whole countries; at the end of this part of the journey, God appears to him and elaborates on the Divine promise made in Abram's homeland. In response to this spiritual experience, Abram builds an altar. Presumably, Abram is feeling a sense of awe, of gratitude, of reverence, and can only think of channeling or focusing these feelings into the form of worship that is familiar to him.
At this point we find a disagreement in the commentaries about Abram's motivations in building the altar. Rashi says that Abram built the altar because of the promise of children and land- in other words, Abram was grateful for the specific content of God's promise to him. This would be easy to understand- who wouldn't be grateful for the promise of a wonderful future?
Ohr HaChaim (a biblical commentator) offers a different understanding of Abram's gratitude:
The intent of the Torah is show us Abraham's [sic] great love for his Creator. For when God appeared to him and promised him descendants and the giving of the Land, he did not consider this to be much, in comparison to his joy at the revealing of the Presence of the Blessed One. This is a fulfillment of the verse: "the fullness of joys is Your Presence." (Psalm 16:11) This is why it says, "then he built an altar there to God Who had appeared to him," because he was so overjoyed at God's appearance to him that he built the altar. (Translation mine, after consulting the translation by Eliyahu Munk.)