The quotation is mangled. It should be "It has been said that democracy is the worst form of government, except for all the others that have been tried." If you analyze the meaning carefully you will see it means that democracy is the best form of government yet tried. It is a humourous and interesting way of saying so.
Interested in Language