Hominids lost any tails we had before we evolved away from the rest of the great apes, which is related to why you should never call an ape a monkey. What could lead to a hominid species re-evolving a tail?
Starting from our current evolutionary state the first step is a sudden mutation to have some form of tail again. This one can be very small and doesn't need to have any real effect.
Afterwards people start to like it. It's unusual and therefore normally an evolutionary disadvantage, but if that individual manages to lead a good life apparently the rest of his genes is very good. Look at peacocks for example.
Tails are starting to be normal
Quite some time afterwards everyone has a tail and people start preferring longer tails that can actually do something, because just having a tail is not good enough anymore.
Suddenly hominids have a prehensile tail.
(Note: some steps may be faster if you start genetically engineering humans to exhibit this trait and selecting them for procreation.)
If you're talking about "natural" evolution,
We has tails for awhile there for (in short) mucking about in trees.
the really obvious future need is
tails make it much easier in zero gravity.
This one is so obvious, unfortunately it's in a number of scifi books already!
(But the tails are usually added by simple genetic work. If you propose naturally-evolving tails, it would simply take, say, 100 million years, like any evolution.)
If you want to exclude space travel. The simple answer is "if for some reason we again had to spend a lot of time in trees." Say you asked "what would make humans evolve gills?" The obvious and only answer would be "if for some reason we again had to spend a lot of time in water."
The purpose of tails (on primates) is mucking about in trees.
(The purpose of tails on incredibly fast quadrupeds - cheetahs. etc - is an extremely sophisticated balance system, allowing for high speed running. But we're primates. Primate tails == trees.)