I would emphathize. "wow you walked 5 miles, I imagine your feet were really tired."
Ultimately it was his choice to walk. I'm sure he could have found SOMEONE from the swim meet to give him a ride in such a pinch, or a friend's house closer to the school or something.
I would probably compliment him on his making it home safely and handling it so you didn't have to leave work to go get him, how responsible. Making the best of a bad situation so it didn't jeopardize your working.
My kids are too darned lazy to walk 5 miles and would have just hassled me at work until I would have left. LOL. But ultimately it was HIS problem. He was the one stranded at the swim meet. (Dang that love and logic class) They would suggest he pay you for a cab ride home. But hey he just saved you the cab fare.
My teen dd,16, she gets her nose out of joint if SHE Changes her plans and I'm not there to pick her up at her whim. So walking home is always an option. I cannot wait until that girl gets her license and becomes a taxi service for her siblings. (Evil laughter)
I guess I'm "mean" and if it was one of my kids I'd probably laugh privately while I thought, "Let the consequences do the teaching." He didn't die from walking 5 miles and I hope he's extra careful in the future about his after school plans. With one car that's got to be tough on the whole family to plan for everyone's activities.
My son did this once in 7th grade but it was only 3 1/2 miles. He didn't wait at the designated meeting place for me. There was a dear friend's house ON the way home, about halfway in fact, where he could have stopped to call me and played games until his dad got off work with the car, but oh no he walked slowly home, brewing over it, and it got dark on him. And he missed the bus because *HE* doddled around and missed the late bus home. (Then I was worried at dark with no phone call and no son arriving home.) These mix ups happen sometimes.
I ask my kids in the a.m. "what are your after-school plans today?" Leaving it open-ended puts the ball in his court.
Then like the other poster's suggested problem solving with him other solutions in case he finds himself stuck somewhere without a ride ever again.