Sagan intended this as an allusion to Thomas Carlyle. 'A sad spectacle!' exclaimed Thomas Carlyle, contemplating the possibility that millions of planets circle other suns. 'If they be inhabited, what a scope for pain and folly; and if they be not inhabited, what a waste of space!' Contact is not the only place this allusion occurs in Sagan, who previously quoted Carlyle during a conference on extraterrestrials; Google makes a video of the conference available online.
Heh... I wonder how many people don't even know that Contact was originally a book by Carl Sagan. Although the movie was more true to the book than most, the book was much better than the movie, as is usually the case.