Physical contacts do not occur randomly, rather, individuals with similar socio-demographic and behavioral characteristics are more likely to interact among them, a phenomenon known as homophily. Concurrently, the same characteristics correlate with the adoption of prophylactic tools. As a result, the latter do not unfold homogeneously in a population, affecting their ability to control the spread of infectious diseases. Focusing on the case of vaccines, we reveal that, provided an imperfect vaccine efficacy, three different dynamical regimes exist as a function of the mixing rate between vaccinated and not vaccinated individuals. Specifically, depending on the epidemic pressure, vaccine coverage and efficacy, we find the final attack rate to decrease, increase or vary non monotonously with respect to the mixing rate. We corroborate the phenomenology through Monte Carlo simulations on a temporal real-world contact network. Besides vaccines, our findings hold for any prophylactic tool that reduces but not suppress the probability of transmission, indicating a universal mechanism in spreading dynamics.