I work in the industry. It may look strange on a computer screen if you don't know what's going on, but it's the cheapest/quickest way.
It has nothing to do with state lines, and everything to do with cost.
For example, a truck with a thousand packages on it enroute from a center to another center is not going to stop at someone's house on the way. It's filled for capacity, not delivery. Think of why a gas tanker drives by your house and doesn't stop at your driveway to fill your car enroute to the gas station.
Generally, linehaul actions take place between hubs and spokes and between hubs. A service center in one town and a service center in another may or may not be handled by the same hub. So it may have to go from hub to hub until it gets to one that does. That may be in another state. Statelines don't really concern the carriers. It's all about how much freight gets moved down that lane that dictates how something travels.
For example, from the end-of-the-line center I work at, your package is going to either someplace in VA, NC, MD or PA first. That's where our servicing hubs lanes are. It's all about freight density. If you live in WV, a shipment might drive right by your house on I-81 to MD to be sorted at that hub and then on to your end-of-the-line center to be sorted again for local routes and delievered.
So sometimes it looks crazy, and sometimes it really is crazy, but you can bet with the bean counters in this industry, it's going the cheapest way.