Think about your example this way:
"Everybody wanted
something."
Something = to go
"To go" in this sense is a noun because it is referring to the action of going.
Other examples as how infinitives can be used as nouns:
"
To excavate the bones of prehistoric human bodies requires several careful steps."
"To excavate" here is used as a noun and is the subject of the sentence
"Our goal is
to finish the project on time"
"To finish" here is also a noun but acts a complement for the verb "is." "To finish" is equal to "our goal"
Perhaps seeing how infinitives are used as an adverb and as an adjective will help your train of thought
"The company launched a new sales division
to widen the markets in the foreign regions."
In the case above, "to widen" is used as an adverb describing "launched." Why did the company launch a new sales division? Because it wanted to widen the markets in the foreign regions
"Tom is looking for something
to eat."
Here, "to eat" is used as an adjective, describing the characteristic of "something"
Can you see how the noun case I first described is different than the adverbial and adjective use of infinitives?
Hope this helps