Uninstalled modules still in system table?
Drupal adds an entry in system table for each module present in the filesystem, even if it has never been enabled. This is the same for Drupal 6 and 7. In Drupal 8 the system table has been removed.

So, if you want to get rid of entries in system table for uninstalled modules, remove them from the filesystem once they're uninstalled.

See _system_rebuild_module_data() for details in Drupal7. In drupal 6 this function was called module_rebuild_cache().