Because the slot count for that item on the server doesn't match that on the client.
The recent client patches added one or more slots to several items, one of which is the musketeer hat. The client uses this information in part to show you whether an item has a slot or not. Whether a card can be put into an item is decided on the server and since the server still has the musketeer hat defined as a slotless item (most likely), the slotting process will be unsuccessful.
This is probably an oversight on their part, so don't expect to get a free slot on your musketeer hat.
Here's a list of items that got one or more slots added to them in the recent patches (October 16th):
Whether they truly possess an item slot can easily be verified.