You can read more about this here.
Because of things I have done on behalf of justice to the workingman, I have often been called a Socialist. Usually I have not taken the trouble even to notice the epithet. … Moreover, I know that many American Socialists are high-minded and honorable citizens, who in reality are merely radical social reformers. They are opposed to the brutalities and industrial injustices which we see everywhere about us.
Many of the men who call themselves socialists today are in reality merely radical social reformers, with whom on many points good citizens can and ought to work in hearty general agreement, and whom in many practical matters of government good citizens can well afford to follow.
(You do remember, don't you, that McCain has referred to Teddy Roosevelt as his hero?)