Shaykh Abd al-Aziz ibn Baz clarifies that it is permissible to earn money from poetry if it is beneficial, Islamic in meaning, and free from prohibited content, similar to selling beneficial books.
Is it permissible to earn money through poetry?
If the poetry is good, and there is a benefit for the Muslims, and the author sells and earns from it such as poetry about Islamic etiquette, rulings and it is about permissible things. There is nothing wrong selling them as in the case of selling books.