Is it just there for legacy purposes or is there still a good reason to use it?
As the commenters have noticed
wp_unique_post_slug is called from
wp_insert_post to ensure there are no double slugs. It is also called from two other functions, which explains why it is a separate function and not incorporated in
A little used feature is the possibility to apply filters present in
wp_unique_post_slug. There are two of them:
pre_wp_unique_post_slugallows you to completely bypass the unique post slug generation, for instance if you want to use a completely different slug for your posts (say, based on some metafield in stead of the title).
wp_unique_post_slugallows you to change the unique post slug that has been generated, for instance if you dislike the number-suffix and want to replace it with something else or if you want to prepend every slug with the post tag or so.
So, apart from the obvious fact that
wp_unique_post_slug is an essential WP function, there are also advanced uses.