We introduce a simple physical picture to explain the process of molecular sorting, whereby specific proteins are concentrated and distilled into submicrometric lipid vesicles in eukaryotic cells. To this purpose, we formulate a model based on the coupling of spontaneous molecular aggregation with vesicle nucleation. Its implications are studied by means of a phenomenological theory describing the diffusion of molecules towards multiple sorting centers that grow due to molecule absorption and are extracted when they reach a sufficiently large size. The predictions of the theory are compared with numerical simulations of a lattice-gas realization of the model and with experimental observations. The efficiency of the distillation process is found to be optimal for intermediate aggregation rates, where the density of sorted molecules is minimal and the process obeys simple scaling laws. Quantitative measures of endocytic sorting performed in primary endothelial cells are compatible with the hypothesis that these optimal conditions are realized in living cells.