Attempted rationalization: Some proto-beavers with sensitive hearing disliked the sound of running water, and discovered they could shut it up by dropping stuff into the stream to plug it up. As an unexpected side effect (evolution cannot expect anything), the deeper water created gave them an increased chance of survival and the behavior spread as they out competed other proto-beavers.
The ones that didn’t do that tended to die before they could pass on their genes.