People with any number of diseases are a potential public health threat. HIV comes to mind. But putting health records into one big database might allow for the types of research to identify patterns of disease that don't rise above the 1 in 1000 or 1 in 10,000 threshold that most studies are limited to. Picking on vaccinations rather than just linking all health records to a centralized database seems narrow and punitive rather that good public policy.
Except that you're not going to catch HIV from somebody standing next to you at the bus stop, just because they said hello to you and breathed in your general direction