Esthetics
The music of language, intricate rhyme schemes, elegant phrases, vivid images - the art of poetry is enough to inspire many to write it.
There is no earthly reason for the existence of Shelley's poem, "To a Skylark" - except that it sounds beautiful. Edgar Allen Poe could have had no reason to write "The Bells" except delight in the music of it -- unless he was cackling with glee over the prospect of generations of readers being driven up the walls by his repetitions.
Which leads into the second category ...
To Have an Effect
Many writers are frustrated hams. We want to "make 'em laugh; make 'em cry." We want to reach out and touch someone -- arouse them to sensuous passion, make them shudder in dread of creepy things in the shadows, enrage them, soothe them. Just to prove we can.
Which leads into ...
Showing Off
Intricate rhyme schemes; alternating trochaic hexameter and anapestic octometer; vivid flights of imagery that leave stunned readers asking, "Huh? Whazzat?" There are many ways to indulge the urge to Show Off, in poetry.
Persuasion
"A spoonful of sugar helps the medicine go down." From satirizing your enemies to promoting your heroes, teaching ethics or arithmetic on Sesame Street or selling cat food, millennia of persuaders have found that people listen to and remember words couched in rhythm and rhyme, and phrased entertainingly.
Communication
This is closely related to the urge to have an effect, or to persuade, but not identical.
I have been writing poetry for a lot longer than I have been writing prose. Often, in conversation, I will want to express an idea - and I know just the poem for it. If it is inappropriate to interject a poem right then, and I have to translate the poem to prose, I feel frustrated. I am convinced the poem said it better.
I have been accused of Showing Off, by reciting too many of my own poems in conversation, but it is hard for me to understand the accusation. To me, the purpose of poetry is communication - I'm just trying to communicate.
This illustrates one of the benefits to understanding a wider variety of the purposes of poetry. People can become confused by another's poetry, if it does not seem to pursue what THEY consider poetry's purpose. A person who believes that the whole reason for writing poetry is to create esthetic works of art, is baffled by the existence of Therapy Poetry. A person who believes that the whole purpose of poetry is to explore and express your innermost feelings, tries to read much more into flight-of-imagery poetry, or parodies, than was ever intended.
This can be frustrating. Leading into ...
Venting
Large numbers of poems are written to vent emotion: anger, anxiety, grief, longing, homesickness, love, lust. Exasperation with red tape. Annoyance at bus drivers. The overwhelming absurdity of a restaurant sign you just saw. All kinds of feelings that you have to express or bust.
Exploration
This is related to Venting, but more extended.
It may not be true that all humans always think in words, but certainly much of what passes for thinking in most of us is in words. And many of us find it easier to clarify our thoughts and our feelings if we talk them over with someone -- or just ourselves.
Free-associating on paper -- which poetry is an excellent way to do -- we can often startle ourselves with insights.
Pouring out an emotion can help us not only relieve it, but eventually understand it better; come to resolution of grief, or rage, and move on.
And sometimes just having something out in print at last can be a relief:
It Was There
Sometimes a poem just comes to you. Then you have to write it down. Then you have to share it. This is part of what being a poet is. (This is also part of what being highly annoyed by poets is.)