All your items (including gems) are stored on a secure server in the Dragon keep.
So this should not happen at all.
However, it might have been an accidental purchase that you have made when tapping all over your islands.
-> Checking your storage to see if there are any new Dragons / Items added
-> Seeing if your resources have increased
Also you should ensure that the "GEM SPEND CONFIRMATION" is showing as "ENABLED".
This way, any purchases over 20 Gems will ask for confirmation.
If you are still concerned after checking, feel free to contact us so we can take a look!