It shows the interconnectedness of mathematics... and besides, people didn't solve Fermat's last theorem because it'd be useful - but they recognised that entire new branches of mathematics, or ways of dealing with problems might open up along the way.