What are Machiavelli's views regarding liberality?
First, it is important to establish that "liberality" for Machiavelli means willingness to spend lavishly, not any political ideology in the way the term is used today. With that in mind, Machiavelli observes that it is good for a prince to be regarded as liberal in nature, but that this raises a problem. If the prince spends the type of money necessary to portray himself as liberal, then he will necessarily have to raise taxes to support such displays of opulence. This will anger his people, and lead to unrest. Thus it is far better to be seen as miserly by one's subjects, because being miserly enables the prince to accumulate the wealth needed to actually administer the state effectively:
A Prince, therefore, since he cannot without injury to himself practise the virtue of liberality so that it may be known, will not, if he be wise, greatly concern himself though he be called miserly. Because in time he will come to be regarded as more and more liberal, when it is seen that through his parsimony his revenues are sufficient; that he is able to defend himself against any who make war on him; that he can engage in enterprises against others without burdening his subjects; and thus exercise liberality towards all from whom he does not take, whose number is infinite, while he is miserly in respect of those only to whom he does not give, whose number is few.
Machiavelli also suggests here that the actions of the liberal prince only benefit a small group of elites and courtiers, while those leaders that wisely save their resources are able to undertake actions which benefit the state as a whole. On the other hand, Machiavelli advises rulers to be very generous with the plunder taken in war, since it does not belong to one's own people:
Because for a Prince who leads his armies in person and maintains them by plunder, pillage, and forced contributions, dealing as he does with the property of others this liberality is necessary, since otherwise he would not be followed by his soldiers. Of what does not belong to you or to your subjects you should, therefore, be a lavish giver...for to be liberal with the property of others does not take from your reputation, but adds to it. What injures you is to give away what is your own.
Here, as elsewhere in the treatise, Machiavelli advises leaders to weigh policies by their consequences. If liberality will not hurt anyone that matters, as is the case with confiscated war booty, then the prince should pursue exactly that policy, which will earn the prince the reputation of being liberal without actually having to make any real sacrifice. If it will eventually hurt the state's finances, leading to more confiscatory taxation that will anger the people, then it should not be pursued. In short, being seen as miserly will not incur the same degree of hate as will the results of having to tax to raise the resources necessary to be seen as liberal.