It may well be that Dante is allowing Virgil, who himself possessed a widespread reputation in the Middle Ages for wizardlike powers (Circle 5, Erichtho), an opportunity to distance his city--and, by extension, himself--from just the sort of activity being punished in the fourth ditch.