Its hard to say for sure without having all of the information, but its possible that you did nothing wrong. Sometimes the fish arent kept in the best conditions by the pet stores and their suppliers, so theyre already sick and dying before you get them home. Since your tank is new, the Anchor Worm could have only come from the pet store. After a while you'll get a better idea of which stores around you take better care of the fish before they sell them to you. Even the best LFS around are still prone to problems though.
Going forward, it will be a good idea to quarantine new fish in a different tank, if possible. That way, if you do end up buying a fish that has Anchor Worm, or some other parasite/disease, you can catch it and (hopefully) treat it before it gets spread to the fish in the regular aquarium.