/etc/rc.local runs as root at the end of the system boot sequence. ~/.bash_profile runs as the user whenever a login shell launches. Neither is a good place to run interactive processes such as "startx". That will make it difficult to boot and log in normally.
If you are using the Foundation's Raspbian image, "sudo raspi-config" has an option to boot to desktop, which may be closer to what you want.