The fish could be itchy, just like when people get an itch and need to scratch it. Otherwise it could be a skin parasite that is starting to affect the fish, possibly whitespot or costia or something along those lines. Monitor the fish for any signs of unusual behaviour (besides scratching) and for signs of discolouration. If the fish change colour, go grey, or look like they have a cream or white film over their body then it can be a problem.
Also check the water quality because poor water quality can irritate the fish and cause then to scratch. Poor water quality will also encourage diseases to occur.