But why would a bear attack the town?
The only reasons I could think of are if:
The town was built in the bear’s territory ( the bear would have to been gone for a long time for the town to be established, so maybe it was hibernating? )
The town’s territory was starting to infringe on the bear’s territory or the people were starting to pose a threat to the bear ( ex: getting the bear’s sources of food, posing a threat to the bear’s cubs, etc. )
The bear had rabies ( would make them a lot more aggressive and prone to attack random people )