While they can be useful, the students’ animals are mainly pets.
Presuming this question is referring to only the students’ pets (excluding, for example, Dumbledore’s phoenix Fawkes, Salazar’s basilisk, and the Dark Lord’s snake Nagini), they’re mostly pets. Owls of course are also a way for students to send messages, though anyone who doesn’t have their own owl can just use the Owl Post, as stated in the question. Having a pet isn’t necessary for class work either, as it’s listed as optional. The list doesn’t stay students may bring a cauldron, their required textbooks, or any other necessary equipment - therefore bringing an animal is optional. Also, some students either never seem to get one or get one later on, such as how Hermione only gets her cat in her third year, and neither Seamus nor Dean (who share Harry’s dorm so he’d likely see their pets at least occasionally) are ever seen with a pet.
Additionally, Ron having a rat doesn’t prove that the students’ animals aren’t pets. There are many Muggles who have rats, gerbils, hamsters, and other small rodents as pets, though they don’t provide the same level of “companionship” as a cuddly pet like a cat. In fact, fish are quite popular pets among Muggles, despite them being confined to a bowl. Ron clearly did see Scabbers as a companion, since when he starts looking sick, Ron’s very concerned and wants to keep him safe, then later is furious at Hermione for getting a cat.
“And what about Scabbers?’ said Ron, pointing at the lump in his chest pocket. ‘He needs rest and relaxation! How’s he going to get it with that thing around?”
- Harry Potter and the Prisoner of Azkaban, Chapter 4 (The Leaky Cauldron)
Ron does occasionally practice magic on Scabbers, who he would have treated like a normal rat since he was unaware his pet was an Animagus. He didn’t do it frequently enough to provide a useful amount of practice, so it’s unlikely he had a pet for that reason. In addition, it was never required for a class, it was just Ron practicing independently.
“He cleared his throat.
‘Sunshine, daisies, butter mellow,
Turn this stupid, fat rat yellow.’
He waved his wand, but nothing happened. Scabbers stayed grey and fast asleep.”
- Harry Potter and the Philosopher's Stone, Chapter 6 (The Journey from Platform Nine and Three-Quarters)
When the students actually are required to practice magic on an animal, the kind they need would be provided in class.
“Professor McGonagall marched into the room without giving the slightest indication that she knew Professor Umbridge was there.
‘That will do,’ she said and silence fell immediately. ‘Mr Finnigan, kindly come here and hand back the homework – Miss Brown, please take this box of mice – don’t be silly, girl, they won’t hurt you – and hand one to each student –”
- Harry Potter and the Order of the Phoenix, Chapter 15 (The Hogwarts High Inquisitor)
The only occasion that a teacher ever makes a student practice magic on their pet is when Snape makes Neville test a potion on his toad Trevor, but that was done as a punishment and to intimidate Neville, not as something required for the class.
Owls are the most useful, as Hagrid tells Harry when he takes him for one.
“I know I don’t have to. Tell yeh what, I’ll get yer animal. Not a toad, toads went outta fashion years ago, yeh’d be laughed at – an’ I don’ like cats, they make me sneeze. I’ll get yer an owl. All the kids want owls, they’re dead useful, carry yer post an’ everythin’.”
- Harry Potter and the Philosopher's Stone, Chapter 5 (Diagon Alley)
While Hagrid isn’t always the most knowledgeable sort, this is supported by the facts, and animals are Hagrid’s area of experience.
Crookshanks, Hermione’s cat, proved to be quite intelligent, though most students’ cats would certainly not be as useful as him. It’s highly likely that he’s half-Kneazle, which would make him different from a normal cat. Crookshanks personally proved to be quite useful, helping Sirius, and later getting Harry and Hermione into the Whomping Willow.
“Crookshanks darted forwards. He slithered between the battering branches like a snake and placed his front paws upon a knot on the trunk.
Abruptly, as though the tree had been turned to marble, it stopped moving. Not a leaf twitched or shook.”
- Harry Potter and the Prisoner of Azkaban, Chapter 17 (Cat, Rat and Dog)
Sirius says Crookshanks is the smartest of his kind he’s ever met. This proves even further that an average cat wouldn’t be capable of the things he’s done.
“This cat isn’t mad,’ said Black hoarsely. He reached out a bony hand and stroked Crookshanks’s fluffy head. ‘He’s the most intelligent of his kind I’ve ever met. He recognised Peter for what he was straight away. And when he met me, he knew I was no dog. It was a while before he trusted me. Finally, I managed to communicate to him what I was after, and he’s been helping me …’
‘What do you mean?’ breathed Hermione.
‘He tried to bring Peter to me, but couldn’t … so he stole the passwords into Gryffindor Tower for me … As I understand it, he took them from a boy’s bedside table …”
- Harry Potter and the Prisoner of Azkaban, Chapter 17 (Cat, Rat and Dog)
So, it’s highly unlikely that other cats (especially non-Kneazle ones) would be anywhere near as useful. Most likely, the other students’ cats are like the cats Muggles would keep as pets, and would be kept for the same reason.
JKR says in a Pottermore writing that these creatures are indeed mainly pets.
In a writing on Pottermore, JKR states that the students’ animals aren’t familiars, they’re mainly pets, though owls can also deliver mail. (Though there is a JKR statement on this, I also wanted to show it in textual evidence from the books rather than just copying it.)
Familiars, in the strictest sense, do not exist within the world of Harry Potter. Although Hogwarts students are permitted to bring animals to school with them, the cats and rats we see there are, broadly speaking, pets. Ironically, the animal that acts most like a traditional familiar in the entire series is Mrs Norris, who belongs to the castle’s only non-magical inhabitant, Argus Filch. It is true that owls are sent as messengers within the series, but this is in the context of a highly organised postal service, not unlike Muggle pigeon post.
Familiars (Pottermore)
The students, therefore, would be bringing their animals because they wanted a pet, though the students with their own owls wouldn’t need to use the Owl Post as much.