Wonder can be used metaphorically to say he is walking purposeless and directionless, as if to set the tone of in the song. The tone in the song could be seen as he (Johny Cash) Reflecting as he Is think about his problems and not concentrating on anything else. Wandering could also mean walking away from his problems to get away from them and the connotations of carelessness in wander reflects on his mood towards his problem.