The most likely answer for this question is that Dante wanted the truth to be known about the characters that he mentions in his book. However, he believed that he would be unable to say these things openly. Therefore, he created an allegorical work in which could state the things he could not say himself. In this way, he protected himself and his reputation while still informing people of things he considered important for them to know.