Seems like this is a very common issue, that although once explained can be fixed. I think there should be a better way of handling this, why not have the Site URL field in the ACP automatically update the json.config?
Or better yet, remove this dependency all together? remove the line from the json.config and just use the site url setting in the ACP.
I was stuck on this for a couple days, because even though I had the host name matching exactly, the fact that the port number was put there by the installation wizard caused me to get the double URL after login.