I am conscious. What's the purpose of me having consciousness? As far as can tell I could have functioned the exact same way without experiencing anything whatsoever.
The serious answer: consciousness has the role to protect the body by adapting to the environment. At the same time consciousness is based on system trained with environment data, all we know comes from outside.