Installing Xcode from App Store doesn't seem to work
Given Xcode.app appears in the /Applications and can be launched, the behaviour suggests Spotlight has yet to notice the newly installed application.

It is likely Apple's App Store application uses Spotlight to determine if applications are installed; thus the ability to Install Xcode.app re-appears on refresh.

I suspect the bug will vanish once Spotlight re-indexes your applications.

Consider telling Apple directly about this bug through their feedback form.