Whats the reason behind the ruling that scratching or touching your scalp gives hands tumah, therefor you need to wash before discussing Torah or reciting a bracha
Shulchan Aruch Orach Chaim 4:18: "These are things require washing with water... One who rubs his head..."
The Mishnah Berurah, (s"k 41), says that rubbing the head is not because of a bad spirit on the hands, which is the reason for hand washing in cases such as getting up from bed or leaving a bathhouse or bathroom, rather it is only for cleanliness purposes, so one needn't race to wash his hands as he does to dispel a bad spirit.
4:21 "One should be cautious during prayer or meals not to touch the leg or thigh or places that are covered by people because they have flecks of sweat in them, and also not to rub his head..."
M"B, (s"k 52), cites Yorah Deah 116 That one must be careful of sweat because all sweat is toxic, except for sweat on the face.
162:8 "If he washed one of his hands and wiped it on his head (meaning in order to dry it, so it was not made impure, as opposed to 164:2 where he scratched his head)"
M"B, (s"k 58), explains that he touched his hair, and even though when he touches sweat he needs to wash again as is ahead in 164, here is different because he is not scratching in between the hairs in a place of sweat, rather he is wiping his and above.
164:2 "One who is standing at a meal and remembers that he touched his leg or thigh or covered places on a person, or that he scratched his head, and anything like this, (and in dirty places, that have sweat in them)... He must wash again and make a blessing."
M"B, (s"k 10), again clarifies that he must be scratching his head, not just touching his hair, recalling 162. He also, (s"k 11), edits the Shulchan Aruch's text of "...and in dirty places..." removing the and, because sweat is that reason for all of these things.
So it would seem that one must wash hands after scratching the scalp because it is a place that has sweat that can be harmful to a person, which is referred to as impurity, tumah, (162:8).