Google will penalize a site for hiding keyword rich text that cannot be viewed by users. They call the practice cloaking: showing content to search engine bots, but not to users.
Note that hiding text that can be shown via user interaction will not be penalized. There are many legitimate reasons to hide text initially but show it when the user needs it. Popular interactive devices such as carousels, light boxes, and fly outs need to initially hide some content.
When text is initially hidden, but can be viewed by users through interaction, Google may choose not to index the words in that text. If it does index them, it may give them less relevance weight than words shown to users on load.
Even though Google can now crawl AJAX pretty well, if you want an AJAX site well indexed, you have to provide a different URL for every piece of content. Single page applications where the URL never changes are still not SEO friendly because Google has no way of deep linking into the content that matches searches.