This phrase has been used since the 1600s to describe the extent to which one is prepared to 'go' in one's opinions, actions etc. I imagine the idea behind it is the notion of actual distance...ie how far would someone go if he promised he would accompany you for part of an actual journey?