Lawmakers did not pass the bill because they believed vaccines were dangerous. It was passed to ensure that there was a constant supply of vaccines available.
In the 1970s and 1980s, the notion that vaccines could have harmful effects prompted a slew of lawsuits against vaccine manufacturers, despite no scientific evidence to demonstrate a causal link between the two (nor has there been since).
With the increasingly litigious American legal system, many vaccine manufacturers opted to cease production of common vaccinations in the early 1980s and by 1985, it was becoming difficult for vaccine manufacturers to secure liability insurance.
As the threat of a vaccine shortage drew near, and prices for common vaccines skyrocketed, Congress stepped in and passed the National Childhood Vaccine Injury Act. This federal no-fault system allowed manufacturers to Manufacture vaccines without fearing legal proceedings, so began producing vaccinations once more.