Flagyl is often prescribed to treat inflammation of the colon, as my GI explained to me when he prescribed it after two stool sample tests came back negative for c. diff. Unfortunately, I had a severe reaction to flagyl and it made my symptoms much, much worse, to the point I was hospitalized.
Coincidentally, it was also prescribed for my dog when I found blood in his stool. Same explanation.