When I picked up my car at the tow yard, the check engine light was on, indicating that my park neutral switch needed to be replaced. Could towing have caused this?
Possibly if they were unable to disengage the vehicle from Park.
Make, model, year, mileage, motor, transmission.
I could make wild guesses without this info, but with it you will get much better answers.
I’m wondering why the car was at the tow yard. I’ve watched cars be both impounded and reposessed, and the process is to bring a tilt-bed, chain the vehicle to it, and drag it onto the tow truck. Often no effort is made to attempt entry into the vehicle and take the tranny out of park. It is not a gentle process to the drive train, and yes it can cause problems.
Why was it at the tow yard?
the check engine light was on, indicating that my park neutral switch needed to be replaced.
Actually it said it received a signal that might be a problem with the neutral switch. I only bring this up because there are a lot of dollars spent everyday replacing parts when they are fine. Maybe a wire came off or something else triggered the light.
If the switch was easy to get to (you did not tell us what make model or year car was involved) and was cheap, I might just buy one and replace it. But remember those codes do not tell you to replace something only it is seeing something that is not expected from that area.