Opinion diversity is crucial for collective decision-making, but maintaining it becomes challenging in the face of social influence. We propose selective exposure as an endogenous mechanism that preserves opinion diversity by forming exclusive subgroups of like-minded individuals, or echo chambers, which have been often perceived as an obstacle to achieving collective intelligence. We consider situations where a group of agents collectively make decisions about the true state of nature with the assumption that agents update their opinions by adopting the aggregated opinions of their information sources (i.e., naïve learning), or alternatively, replace incongruent sources with more like-minded others without adjusting their opinions (i.e., selective exposure). Individual opinions at steady states reached under these dynamics are then aggregated to form collective decisions, and their quality is assessed. The results suggest that the diversity-reducing effects of social influence are effectively confined within subgroups formed by selective exposure. More importantly, strong propensities for selective exposure maintain the quality of collective decisions at a level as high as that achieved in the absence of social influence. In contrast, naïve learning allows groups to reach consensuses, which are more accurate than initial individual opinions, but significantly undermines the quality of collective decisions.