Machiavelli himself was a great proponent of liberty. Very explicitly so. But he knew that rainbows and unicorn farts do not produce liberty. Only power can defy power. Only a good guy with a gun can defy a bad guy with a gun.
The burghers that arose in Italian city states were very 'Republican' in their attitude and did not trust elite rule. As a consequence Italy was fragmented into a bunch of city states and none of them alone could defy the will of the French or holy Roman empire.
Machiavelli therefore wanted a united Italy under an autocratic prince...who was capable of keeping their power because they understand the nature of power...and hopefully faithful to the ultimate goal of liberty.
These are truths that midwits seem incapable of understanding and why half an education is even more dangerous than zero education.