Why did Du Fu say that his handwriting was not good-looking?

The reason is out of personal modesty and the pursuit of perfection.

This is because Du Fu is poking fun at himself or modestly praising his calligraphy. In fact, Du Fu's handwriting is said to be really good. Du Fu's calligraphy is called "neatness", and it is no exception in Li Shu. Du Fu lives in an era of literati, and may compare his own handwriting with others, thus feeling that his handwriting is not good enough.