When your package has been delivered to another state it could be because the package just got scanned wrong and then sent onto the wrong truck.
Also some packages go onto trucks that are headed for another state before they get back onto the correct truck to be delivered to your state.
I've had FedEx packages, USPS packages, UPS packages etc all go to different states before and then come back into my state.
But if your package was sent to an address in the wrong state it could be because of a scanning error or a human error.
If your package went to another state you should contact either USPS, UPS or FedEx whichever the shipping company is and find out why it actually got delivered to that state and then they can route the package back to your address.
Also contact the sender of the package as they can find out what happened as well.