You're right that McCain's actions are in sharp relief to many prominent Republicans.
For me, his choosing of several years of torture instead of being released from captivity in order to honor the military code of conduct is a sign that he was overall a good person.
In mid-1968, his father John S. McCain Jr. was named commander of all U.S. forces in the Vietnam theater, and the North Vietnamese offered McCain early release[44] because they wanted to appear merciful for propaganda purposes[45] and also to show other POWs that elite prisoners were willing to be treated preferentially.[44] McCain refused repatriation unless every man taken in before him was also released. Such early release was prohibited by the POWs' interpretation of the military Code of Conduct which states in Article III: "I will accept neither parole nor special favors from the enemy".[46] To prevent the enemy from using prisoners for propaganda, officers were to agree to be released in the order in which they were captured.[35]
Beginning in August 1968, McCain was subjected to a program of severe torture.[47] He was bound and beaten every two hours; this punishment occurred at the same time that he was suffering from dysentery.[35][47] Further injuries brought McCain to "the point of suicide," but his preparations were interrupted by guards.
You're right that McCain's actions are in sharp relief to many prominent Republicans.
For me, his choosing of several years of torture instead of being released from captivity in order to honor the military code of conduct is a sign that he was overall a good person.