Why did I still get whooping cough as a child even after having all the vaccine shots?

Not 100% Vaccines really have been a major improvement in public health but no medicine is 100% effective. When vaccines don't prevent a disease they do usually make it much lighter. We also now know that most vaccines do not last forever . Boosters are often needed later in life.
Individual factors. The vaccine used during your infancy was quite protective for most people but not totally. It was rarely if ever given over the age of 6, and teens and adults were common carriers.Since it is often most contagious early in the incubation phase, it passes readily from adults to kids or other kids well before the coughing phase starts.The newer vaccine can now be giver to older kids and adults.
Imperfect vaccine. Unfortunately the vaccine for pertussis, commonly known as whooping cough, is not perfect. Even with a full course of vaccines, you can still get infected. While this is probably true for all vaccines, the pertussis vaccine is a prime example. If you are planning to have children, you should consider getting a booster vaccine. Newborns can have a fatal infection without ever developing a cough.