Swift wrote "A Modest Proposal" after experiencing frustration that a series of reasonable proposals he had made for alleviating the plight of the Irish poor were ignored. His audience, for the earlier proposals as well as this piece, were the wealthy Anglo-Irish who had most of the money and power in Ireland—the very people who would have had the wealth to feast on such a gourmet item as a roasted baby or who could have sponsored a hunt of a child nearing adolescence.
Swift was a dean, a high clerical position in the Anglican Church, and he felt compassion for the poor. His goal was to shock the wealthy and powerful into making some small moves to ease the burden and stranglehold on the poor, who were charged very high rents and prices while having almost no job opportunities. He wished to shock the wealthy with a proposal that was so outrageous that they would sit up and take notice. He hoped they would be so appalled at the idea of eating babies that a more humane response to poverty might begin to appeal to them.
Swift's scheme backfired. Then as now, people have trouble reading irony, and they mistook the views of the clueless narrator as Swift's own. They ended up appalled at him thinking him a misanthrope who made inhumane proposals.