It does not appear that the bear climbed the tree to attack; rather, it climbed the tree because it was trying to avoid a larger bear in the area. It climbed defensively -- and happened to pick the tree that had two humans in it.
The fact that it chose to stay in the tree where it could smell the humans tells me that the climbing bear was more scared of what sent it up the tree in the first place.
Now that makes sense. I think you've nailed it.