I am guessing you did a startx as root (sudo) in your pi home directory. /home/pi.
The startx command probably created some files in your pi home directory. If so, when you do a startx as pi, it cant use those files as they are owned by root.
log in as pi, make sure you are in /home/pi and try this command:
<DANGER> If you do this command somewhere other than /home/pi you could really screw up your RPi's OS. </DANGER>
This should make pi the owner of all files in that directory tree.
A slightly safer thing to do would be to do a
in the pi home directory and change the ownership of any file owned by root to pi. ie:
You have to use sudo in this case as some of the files could be owned by root.
Remember, when running as root or doing a sudo command there are no safety checks.
It assumes that you know what you are doing.
If it ain't broke, take it apart and see how it works.