To my knowledge it is not illegal to euthanize an animal by gunshot in any US state.
From a practical standpoint, it's probably the most humane way to do it. There's far less pain and emotional distress (for the animal) involved than in any other means I can think of, including having a licensed vet come to your home and put the animal down via injection.
It's also significantly less expensive than any other means which is an important consideration for much of the country. Hiring a vet to come out to your home to euthanize an animal can be hundreds of dollars - it was $350-$500 in Virginia when we checked in to it there. A .22 LR round is ~$.10, and a well-placed round to the base of the brain is instant.
There are downsides, of course. It requires knowledge of anatomy, and it can be bungled badly. Cats, like many animals, are prone to spasming when the CNS is destroyed, which is certainly not something that I'd want my kids to see.
All in all, I'd much prefer to either have a vet come out or obtain the necessary injections to do it myself at home - but I have financial resources at my disposal than the vast majority of families in my area do not. Given the choice between waiting for a dog or a cat to die of a long, painful disorder and their owner euthanizing them with a firearm, the latter is much preferable.