Deuteronomy 4:19
I answer that, As we have said above (Q[65], A[2]), a corporeal creature can be considered as made either for the sake of its proper act, or for other creatures, or for the whole universe, or for the glory of God. Of these reasons only that which points out the usefulness of these things to man, is touched upon by Moses, in order to withdraw his people from idolatry. Hence it is written (Dt. 4:19): "Lest perhaps lifting up thy eyes to heaven, thou see the sun and the moon and all the stars of heaven, and being deceived by error thou adore and serve them, which the Lord thy God created for the ...service of all nations." Now, he explains this service at the beginning of Genesis as threefold. First, the lights are of service to man, in regard to sight, which directs him in his works, and is most useful for perceiving objects. In reference to this he says: "Let them shine in the firmament and give life to the earth." Secondly, as regards the changes of the seasons, which prevent weariness, preserve health, and provide for the necessities of food; all of which things could not be secured if it were always summer or winter. In reference to this he says: "Let them be for seasons, and for days, and years." Thirdly, as regards the convenience of business and work, in so far as the lights are set in the heavens to indicate fair or foul weather, as favorable to various occupations. And in this respect he says: "Let them be for signs."
Source: Summa Theologiae, First Part, Question 70, Article 2