Git is probably already tracking the file.
In order to stop tracking a file that is currently tracked, use git rm --cached.
Use the following chunk of code but don't forget to replace [project] and [username] with your info:
$ git rm --cached [project].xcodeproj/project.xcworkspace/xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate
$ git commit -m "Removed file that shouldn't be tracked"
Alternative way: You can also use the -a option to git commit that will add all files that have been modified or deleted.
Once you have removed the file from git, it will respect your .gitignore.