Killing Gus right now would be a bad idea for Walt and Mike as well. Gus is paying them millions to do what they do, but that all goes away if they kill Gus. Mike & Walt know nothing of the distribution side of the business, the money laundering & cover businesses, the relationships with other cartels, the protection required for the sales force, or the other various pieces of the business. They would need a plan before killing Gus, and Mike probably knows that.
I don't think Mike's loyalty to Gus is strong at all, and he's probably thinking about his exit strategy after the Victor incident. But Walt is thinking irrationally right now and Mike knows it. Maybe this beat-down will straighten Walt out so that he and Mike may actually be able to team up in the future.
Also, immediately before the ass-whipping, Walt said "get me into a room with him and I'll do the rest" as if he's the trained hitman instead of Mike. That would be like Mike lecturing Walt about the periodic table. If I were Mike, I'd probably be offended by Walt's comment. Perhaps that's what triggered the beat-down?