Both Perry and Gramm had to run for office and win as Republicans. And I would suggest that Perry is not the best example for you to cite.
Judge Sam Sparks has given a number of liberal rulings in the last 14 years, and as someone who lives in the same county, I can vouch for him not being any type of Republican I'd recognize at a party event.
Sam Sparks is not a conservative but a Strayhorn RINO-type Dem-then-Repub-now-independent type:
"Carole Keeton Strayhorn and the undersigned have been life-long friends. It is a matter of public record the undersigned and his wife have long supported Carole Keeton Strayhorn in her political endeavors and have signed her petition to be an independent candidate on the ballot for the governors race in the upcoming election. For these reasons and to avoid any appearance of impropriety the undersigned recuses himself in this case."
http://capitolannex.com/?cat=16