Plot twist: Social and funny in real life, awkward on the internet
Kaneki was subjected to extreme physical, mental & emotional stress. He was repeatedly tortured, constantly in pain, hungry and on the verge of losing his sanity.
It is said that when a person is under stress certain changes occur in their body. For instance people who suffer from malnutrition in real life tend to have changes in their skin, nails & hair (Skin may appear dry, and flaky and hair may turn dry, lifeless, dull and appear like straw. Nails may appear brittle and break easily).
This fact in real life was exaggerated in Tokyo Ghoul to highlight the “transformation" in Kaneki.
The anime showed it as an abrupt change but in the manga this was something that happened over a period of time (Kaneki was tortured by Yamori for 10 days!!).
The change in hair color is symbolic in illustrating Kaneki’s change in perspective, priorities & personality.
Note that in the anime the hair color change occurred when Kaneki (while hallucinating about Rize) finally embraced his inner ghoul, perfectly timed with him saying the iconic line “I AM A GHOUL”.