Sure, the worms aren't characters in the typical sense, but they are an important part of the story, and hey, where else were we going to put them? Besides, they deserve their time in the spotlight.
Dune is science fiction, but it includes many elements borrowed from fantasy. The worms are one such element. Oh, you don't remember giant sand worms roaming about in The Hobbit? But you remember a character named Smaug, right? Exactly: the worms are the archetypal dragon figure (source). Herbert may have changed their body type a bit, but he kept a lot of their personality intact.
Like Smaug or the unnamed dragon from Beowulf, the worms guard a golden treasure and will kill all who come to steal it. In this case, the treasure is the spice, the "most precious" substance in the universe (43.225). And just like dragons, the warriors of Arrakis must conquer the worms through intelligence, strength, and sneaky tactics to reach the treasure.
But unlike Beowulf, the Fremen do not kill these creatures. Instead, they ride them into battle—a much better idea in our opinion.