The solution given by "hand" is correct; here is the explaination you seek:
When you created your string using the heredoc, all of the carriage returns and newlines are preserved. They are actually placed into your variable. Even when you ECHO()d the variable, the carriage returns and newlines are also output. If you view source on your web page you will see that the text is output the way you specified with the heredoc.
The reason all the text is run together in your browser is due to the way browsers interpret the string. Carriage returns and newlines are interpreted by the browser as spaces, and multiple consecutive spaces are further interpreted by the browser as a single space. The rules of HTML state that if you want the browser to actually render a newline or linebreak, you must specify so with one of the HTML tags such as <BR> or <P>.
That is why the nl2br() function is used; it changes all of the newline characters in your string to <BR> tags so the browser will render the text the way you intended.