My question involves civil rights in the State of: Virginia

A judge gave a defendant a choice of a private attorney or public defender, and the defendant chose to see if he qualify for a public defender. The defendant was told that, because he is in the military (though he was not receiving any pay at the time and he is only an E-2), he did not qualify. He later found out that one of his shipmates qualified for a public defender when they are the same rank and pay. Is this not a denial of his rights of a court appointed attorney when he clearly could not afford a private attorney?