That's the million dollar question!
Without written records, this question is left mostly to speculation. Some things seem obvious - particularly regarding what they are not: they are not for habitation or defense (there is no archaeological evidence of either). Given the effort that these monuments took to build and ruling out habitation and defense, most people have deduced that they were for ritual purpose. While that may seem obvious, nothing should be assumed with regard to these prehistoric monuments. That said, "ritual purposes" is decidedly unsatisfactory since what we really want to know is "what ritual purposes?"
Many have identified solar and/or lunar alignments for at least some of the circles. This does not necessarily mean a solar/lunar cult, however, since the emphasis may have been on the unfolding of seasons, and here is the heart of the greater problem: virtually everything is, again, left to a rather unsatisfactory degree of speculation.
Recent archaeological work in the vicinity of Stonehenge has added a great deal of information that adds to our ability to speculate. Extending this information to apply to the dozens of other stone circles is problematic, but not without some justification.
Recent archaeology has identified a seasonal settlement near Stonehenge, connected to the stone monument with an avenue. Speculation suggests that all of this may be evidence of ritual associated with the depositing of human remains and the honoring of the ancestors. But then, there's that "s" word again. No matter what anyone says the purpose of the stone circles was at construction, it will always be based on speculation.
Then there is also the matter of changing purposes: religion, culture, and people change. These circles have been around for a very long time, and they have stood as silent witnesses to many changes. There is some evidence of later people using at least some of the monuments for their own ritual purposes, but the original purpose was likely as much a mystery to these later generations as they are to us. And each subsequent generation of use and projected meaning is, again, speculative, until we have written and other documents to indicate purpose: when neo-druids began using Stonehenge in recent decades, we finally arrive at a point where we can understand "purpose" based on documentation.