The Teacher displays a very limited and bleak view of life after death. Apart from the teaching of the New Testament, his view would be a common one.
It is shared today by many on our college campuses. When we die, we return to the dust and that is it! Not only that, but we are no better than the animals because we share the same fate as they do.
The Teacher is honest with his doubt that we can know where our spirit goes upon our death. Again, apart from the teachings of Jesus later, this is an appropriate question.
But the New Testament and the life and resurrection of Jesus that it teaches provides an answer to his question at the end of verse 22. We now know that death is not the final answer. Those who commit to following Jesus as their Lord and confess Him as their Savior can know where their spirits will be going when they die!