This question only seems to come up in the West, where the idea of religion seems inextricable from theism. In predominantly Buddhist cultures, there is no debate: it’s considered a religion.
One particularly inclusive view of what constitutes a religion stipulates that a religion has four elements:
A body of devotional practices, or ceremony
A body of doctrine
A community of followers
A code of behavior
Various religions may emphasize one or more of these aspects, but all will be represented.
Buddhism definitely has ceremony and devotional practices. Lots of them.
Buddhism has what passes for a doctrine: the Dharma (teaching), though as doctrine goes it is quite “soft” in that it is not to be accepted on faith. Since Buddhism has no unquestioned authority figure, these are all just the observations of practitioners who have trod the path before us. The “real” teaching is to be found through direct experience.
There is a community aspect to Buddhism, the “sangha”, though that too is rather “soft” and can be considered to include not just fellow Buddhists, but all beings.
And finally, there is a code of behavior: the precepts. These were originally the rules that governed life as a monk, but a slimmed-down version is adopted by many lay followers as well. They are there to warn us against behaviors that cause harm or cloud perception of reality.