Dams create large bodies of water that change ecosystems and provide focal points for human communities. They certainly do more than just hydroelectric.
An example would be Lake Pillsbury in Northern California which the dam has not done hydroelectric for decades but the fight to prevent demolishing the dam has had plenty of local support.
In addition to other answers, dams are sometimes used for mechanical power without generating electricity. More likely to be historic use than current use, but also likely to be a candidate for removal for fish habitat.