Obama always cared about appearances. Investigations at that level also take a long time. You have to remember that they thought Hillary had it in the bag. Giving the appearance that they were using prosecution to stifle a political opponent would have been dangerous. Media rumormongering and selective leaks are par for the course for both parties, but directly prosecuting opponents is still a bridge seldom crossed.
Plus, always remember that Comey was on Trump's side until Trump got elected and started demanding oaths of loyalty and interfered in investigations.