Go to Control Panel, open Display, go to the Settings tab, click Advanced,
look for a tab that has controls for this function. This is a function of
the drivers for your graphics card. If there is nothing in this area, try
the monitor's onscreen controls, you may need to check the monitor's
documentation for this information, there may be a control to set the screen
right side up again and not, it may just be a control to flip the screen
which should restore it from its current position.
I can't say why this happened as this is not an XP function so it must have
been some issue between your graphics card drivers and the Accessibility
options or, you may have a virus that is causing this. Hence, if none of
the above resolves it, try running an antivirus scan on your system. Also,
download, install and run Ad Aware as it might pick up something that is the
source of the issue.