Even though cash sitting in your brokerage account earns nothing, it allows you to take advantage of special opportunities as they come up. For example, during the recent plunge in the gold stocks, there were bargains to be had. If you are always fully invested, you have no ability to take advantage.
When the market is strong, I stay fully invested and heavily margined, but when things get shaky, I like to hold cash and lie in wait....