Bear spray is a good item to have with you and on you when hiking. Can work on bears and also on bison and possibly on a mountain lion. Good for protection against aggressive dogs which cause more fatalities in the USA than all the wild animals combined. Problem is that the attacking animal has to be downwind if there is any breeze at all or the spray will come back into your face.
I don't worry for two seconds about some law enforcement person with regard to bear spray. Worst case it is confiscated. Best case it saves your life. And unlike a firearm you are not going to kill someone by accident.