I'd like to know when it is encouraged to itch something, if ever. I kind of have a hard time understanding how the body could evolve to enjoy scratching itchy areas if it was bad for us, so it must be good for us some times, right?
Itch is an unpleasant feeling and scratching often results in a temporary itch relief even if it does not promote healing. Isn't itch relief by scratching already beneficial? Or, say, painkillers: they usually do not treat anything, but they can relieve pain.
The feeling of itch and pain are conveyed by similar nerve fibers and they kinda compete with each other: pain induced by scratching can abolish itching sensation. This may also work the other way around: opioids that block pain sensations can induce itch. (Nature Reviews Nuroscience).
The "logic" behind the scratch reflex is to encourage you to remove the irritant. You can remove an insect and some dirt or fungi this way. On the other hand, if you scratch eczema, you may only make the itch worse.
Your body may not be the most intelligent when it encourage you to scratch, but you can learn what to scratch and what not. If our bodies did not evolve well enough, our minds can evolve more.