The major distinction to keep in mind here is that in Christian theology there are really two churches. One is the ideal church which is the Christian community as it follows and embodies divine will, and the second is the church as a fallible human institution. The difference between the two is original sin, which ensures that all human acts and institutions are by their nature flawed. Thus, when Dante criticizes the Church, he is not being a radical opponent of the Church or anti-Christian, but rather participating in a traditional theological exercise of showing how the human Church necessarily fails to live up to its divine ideals due to human fallibility. The critique is not of the Church per se, but of the flawed humans who err in embodying a divine institution due to the inherently fallen nature of humanity. He thus condemns members of the clergy who do not live up to the ideals of the Church and Bible. This is exemplified by his dressing hypocrites in garb similar to that of Benedictine monks whose luxurious lifestyle was in direct opposition to their vows.
In Dante's period, the Church was notoriously corrupt and filled with scandals. One of the greatest objections Dante voices is that many of the clergy have fallen prey to the sin of avarice. Rather than living a life of poverty and renunciation, they live in great luxury. He also strongly condemns the practice of simony, the sale of church offices for money. He sees, quite accurately, that this leads to clergy who are not knowledgeable or pious; often the second and third sons of the wealthy purchase the office and then live luxuriously at the expense of the Church coffers (Inferno 19.1-4; 55-7; 106-11). He also displays some discomfort with the practice of selling indulgences.
Next, he objects to the interference of the Church in politics, believing that this lust for secular power corrupts the Church. Pope Nicholas is condemned to Hell for his territorial acquisitions as well as nepotism. Pope Clement V and the Avignon papacy are similarly condemned as examples of the Church seeking secular power.