Could be a number of things that caused it. Most likely something in your diet.
Is this the first time this has happened?
What does a normal day of eating look like for you?
Are you exercising? (what is your hieght, weight, and age)?
This resource expalins how to get rid of your hemorrhoids naturally.
Man that looks nasty... It's likely to be a hemorrhoids for so much blood to appear in the bowl. Apply some hemorrhoid cream like Preparation H. You can also follow some of the hemorrhoids home remedy tips on my site, but you should get yourself properly examined first.