Joseph, his identity fully secured against his brothers, really kind of hams up the role, now. Which, as we’ve said, is really kind of a soap opera plot, so why not? He accuses his own brothers of being spies. Which, really, is not that much of a stretch when we consider things from a strategic standpoint.
Egypt is at a time of famine. While Joseph stored up, that doesn’t mean that everyone is sitting hunky dory. With no new incoming food, there will have to be rationing of what was stored up, and this is in a time without refrigeration or vacuum sealing, so there will inevitably be some spoilage.
Furthermore, this is when other nations would probably start becoming desperate as their own situation worsens. If they did not store up like Egypt, that means they’re hurting, probably badly. Their neighbors, though, are looking pretty fat and fed, in comparison. A quick campaign or at least a few raids could see that food helping them instead of Egypt.
So this is not an unreasonable accusation to make, especially for a paranoid governor of Egypt. However, we know that Joseph knows that they aren’t spies, so this is done to put the brothers on the defensive, and to safely probe them for information about home, which is what Joseph really wants to know about. It’s roundabout, yes, but the only other way he’s going to get information is to reveal himself to them, but that’s not really an option.