Dogs, like people can be lactose intolerant. It will give them digestion problems .. But, if your dog isn't intolerant .. he may have just coincidentally 'had to go'. It's hard to judge with only one episode.
As a rule, it's not wise to feed a dog a lot of cheese .. it can cause constipation (like it does in people). Small amounts as a treat, shouldn't bother him.
They really don't need a lot of cheese. It's a treat. What kind of cheese was it? American cheese is not good for them. A natural cheese or cottage cheese is fine. Your dog may not be able to handle dairy at all, though.
Cheese is high in fat so can cause obesity in the long term, and constipation in the short term. If you want to mix your dog's food with something yummy, go buy a can of pure "pumpkin puree" - it's got lots of vitamins and fiber in it, and my dogs love the stuff (just a spoonful per 40 lbs of dog.)