Why did ancient people like to write poetry? Is it the same as modern people like to write songs?

Not entirely. Ancient poetry was part of the imperial examination in the Tang and Song Dynasties. Poetry was also tested in the Ming and Qing Dynasties, although it was not the focus. Especially in the Tang Dynasty, poetry was an important channel for the lower class to enter the upper class society. Therefore, poetry has been a required course for ancient literati for a long time. Just like our college entrance examination and civil servant examination today, it has a strong utilitarian purpose. The more people who compose poetry, the more excellent works and authors will appear.

When the Yuan Dynasty did not pay attention to the imperial examination, the focus of the imperial examination in the Ming and Qing Dynasties was the eight-legged essay. Therefore, the ancient poems of the Yuan, Ming and Qing Dynasties were far behind those of the Tang and Song Dynasties, because the literati all learned to do the eight-legged essay.

Modern people write songs either for no utilitarian purpose or to make money, so songwriters are relatively niche.