Here's why:
* "To go" is a verb, indicating an action.
* "To sleep" is the object of the verb "go", meaning it's the thing you are going to do.
* Nouns name people, places, things, or ideas, and sleep is an idea or state of being.
Let me know if you'd like to explore other parts of speech!