In many parts of the world, social norms of cooperation are an important element of decentralized water governance carried out by local communities. Field work in Cambodia documents that some villages have well-functioning water infrastructure and high cooperation, while others have poor infrastructure and low cooperation. We hypothesize that this outcome may be the result of an institutional trap, where initial lack of cooperation leads to poor infrastructure, water scarcity, and low revenues, undermining cooperation further in a vicious cycle. Conditional cooperation may explain why some communities can overcome such an institutional trap. We develop an agent-based model, in which users have to decide how much to contribute to water infrastructure and how much water to extract. This decision is based on economic considerations, but also reputational concerns, where own decisions are evaluated against the social norm. We find that the system features alternative stable states, depending on initial conditions. If the system has initially a functioning water system and high cooperation, prosperity can be created, which facilitates further investments in water infrastructure, fostering cooperation further. If the community features initial scarcity, cooperation is relatively costly, undermining investments in water infrastructure, leaving the community in an institutional trap.