Perhaps they were hungry, but wanted to see if it was going to be tasty?
I think it is strange that they couldn't tell that nothing bad was inside the cake from the x-ray, however, maybe they wanted to make sure it wasn't filled with some sort of gel?