Because G-d said in Leviticus that you are not allowed to eat. You will get many beautiful answers about what YK is about; however, this is the reason for the fast.
Everyone makes mistakes -- it's only human. A lot of times, we feel bad if we do something we shouldn't. But what is done is done.
On Yom Kippur, God gives the Jewish people a special opportunity to erase our mistakes. "I know you make mistakes, my children," He tells us, "but if I see you're truly sorry and want to do better next time, I'll forgive you and give you another chance."
The Jewish people fast on Yom Kippur. By not eating, we spend more time thinking about how we can improve ourselves, and also show God that we're willing to make sacrifices to do it. He sees that we're sorry and are going to do better from now on, and is happy to forgive us.