He was given the option to “skip the line” since his dad was an admiral. I think the way it worked is the POW who had been there longest would be first to leave when there was an exchange opportunity. McCain saw it as unfair for him to take someone else’s spot just because of who his dad was.
I think this is one of the circumstances where if he took the opportunity, it wouldn't be consider favoritism but rather of a strategic necessity considering how John Mccain's admiral father's decision making could be compromised by any risks such decisions could have towards his son's welfare.
Of course there are way more variable involved, but I think his refusal was mostly on the basis of maintaining solidarity with the other POWs. In that situation, I could imagine that one of the few things that would keep me going was knowing that the thing i was fighting for back home wasn't just a delusion.
If the other POWs saw Mccain released for on political reasons, then who is to say that the POWs loyalty to their nation wouldn't have been compromised?