When you are tired and sleepy, you are inclined to close your eyes and have difficulty focussing. Essentially you feel that it is hard to see. So you rub your eyes, much as you might do if you had water or spider webs or dust in them. Remember how some people speak of the Sandman as the bearer of sleep? He is supposed to fill your eyes with sand so that you can't open them. It is the same impression of something in your eyes that led to the Sandman idea and causes you to want to rub them.
Maybe we rub our faces to stretch them like we do with our bodys and rubbing invigourates blood blood flow just like massaging which refreshes us (depending on the massage of course)