First of all, it didn't have a negative meaning. In the ancient roman republic, a dictator was a single person who was given absolute power to deal with a crisis and once the crisis was over, they handed the power back to the Senate. It wasn't until Cornelius Sulla that the word started to have a negative meaning.