Answer: He wanted to represent his lack of luck as a writer, using the character Santiago as a portrayal.
Explanation: Hemingway had a great reputation, but he was in a streak of bad luck creating a good story. Therefore, he writes a similar story for the character Santiago. After going 84 days without catching any fish, he is encouraged by his young apprentice to go further and break his unfortunate streak . Santiago is a man who remained cheerful besides being mocked by people, and hurt when catching the big Marlin.
The author wrote this as a metaphor to remain strong amongst his struggles in life.