Since a recent version (no idea which) spectators can also look into non-container blocks (crafting tables, cartography tables, stonecutters, anvils, enchanting tables), but they still can't look in ender chests, command blocks and structure blocks.
Either spectators should only be able to look into containers, or be able to look into all blocks with guis.
Related issues
is duplicated by
Comments

Ender chests have a an individual inventory for each player that is why