Can An Ending Ruin a Film?

Why can a bad few minutes destroy a good couple of hours?