Some people say Dante called the poem "Comedy" (the adjective "Divine" was added later in the 16th century) because poems in the ancient world were classified as High ("Tragedy") or Low ("Comedy")
Others say because it has a happy ending.
*hope this helps