It is not the game, it's the 3DS.
There is some sort of gyroscope like device in the 3DS, which allows it to sense which way it is being turned. This is the first and only time the 3DS gyroscope has been used in a Pokemon game.
Example of a device with a gyroscope: Nintendo Wii remotes have gyroscopes on them. Almost (if not all) all Wii games use the gyroscope so if you have ever played a Wii game you know what I am talking about.
As for evolving your Inkay try doing the entire battle upside down just to be safe. To make this easier, hang over the side of your couch or bed upside down. Make sure your 3DS is not upside down for you but it is for other people, just sit on your bed, couch, etcetera holding the 3DS the correct way, and flip over the side of the couch. Doing that will make the DS think it is upside down! (Which it is, but not for you.)
NOTE: Do not stay upside down for too long!
Hope I helped!
Source: Knowledge, and my geniusnesseseseses (You get the point)