Why was remote work rare prior to the pandemic? One possibility is that remote work reduced worker productivity. Another is that it attracted less productive workers. We test these possibilities in the call-centers of a Fortune 500 online retailer. We find that working remotely increased call-center workers' productivity. When previously on-site workers took up opportunities to go remote in 2018, their hourly calls rose by 7.5%. Similarly, when COVID-19 closed on-site call centers, a difference-in-difference suggests that the productivity of workers who switched to remote work rose by 7.6% relative to their already remote peers. Despite these positive productivity effects, remote workers were 12pp less likely to be promoted. If better workers are more concerned about being overlooked in remote jobs, remote workers will be adversely selected. Consistent with this theory, we find evidence that remote work attracted latently less productive workers. When all workers were remote due to COVID-19, those who were hired into remote jobs were 18% less productive than those who were hired into on-site jobs. Extending remote opportunities to on-site workers similarly attracted less productive workers to on-site jobs. The sorting of workers by ability meant some workers opted out of remote work because they did not want to pool with less productive workers. This led to deadweight losses in the market for remote work. Looking forward to life after the pandemic, our model suggests that COVID-19 could attenuate these losses if firms have learned how to better evaluate remote workers or workers' tastes for remote work have become more heterogeneous.