In chapter 16 of The Prince, Machiavelli writes about liberality/generosity that in being generous, a prince will bankrupt himself and as a result need to increasingly tax his subjects which will make them angry, thus nullifying the original intent to be loved by them and make the prince weak and impotent because of lack of funds.
He then gives examples of rulers such as Pope Julius II and Ferdinand II of Aragon who were not generous with money which allowed them to achieve great conquests and wage wars successfully because they didn't overtax the population and had disposable income to finance their wars.
Nicolo also talks about Caesar, writing that while he was generous in his rise to power, he did so only because he was not already a prince, and needed to act in that way to achieve power, and that afterwards upon becoming a dictator for life, if he had not been assassinated, he would have to become more sparing, else his government would collapse.
And there is nothing wastes so rapidly as liberality, for even whilst you exercise it you lose the power to do so, and so become either poor or despised, or else, in avoiding poverty, rapacious and hated. And a prince should guard himself, above all things, against being despised and hated; and liberality leads you to both. Therefore it is wiser to have a reputation for meanness which brings reproach without hatred, than to be compelled through seeking a reputation for liberality to incur a name for rapacity which begets reproach with hatred.
The Prince, Ch.16