Custom Block Content with HTML and PHP
The problem is the lack of a return value in facebook_main_contents(); As you can see in the api documentation $block['content'] should contain either a Drupal render array or fully rendered html. facebook_main_contents(); is not actually returning anything but instead echoing output to the page.

You need to collect your rendered html and return it, like so:

$content = "&lt;div class=\"fb-feed\"&gt;";
// check if post type is a link
if ($post['type'] == 'link') {
  $content .= "&lt;p&gt;" . $post['message'] . "&lt;/p&gt;";
  $content .= "&lt;a class=\"container\" href=\"" . $post['link'] . "\" target=\"_blank\"&gt;&lt;div class=\"sharedlink\"&gt;";
  $content .= "&lt;div class=\"image\"&gt;&lt;img src=\" " . $post['picture'] . "\"/&gt;&lt;/div&gt;";
  $content .= "&lt;p&gt;" . $post['name'] . "&lt;/p&gt;";
  $content .= "&lt;/div&gt;&lt;/a&gt;";
  $content .= "&lt;div class=\"posted\"&gt;Posted on: " . date("jS M, Y", (strtotime($post['created_time']))) . "&lt;/div&gt;";
}
...

return $content;