It is a mixture of the words, hilarious and bad. When something, either serious or a not so funny joke, is utterly terrible that you have no choice but to laugh at how terrible it is.
Joey: You know the show Avatar the Last Airbender?
Sean: Of course, that's like my favorite cartoon.
Joey: Yea, but the movie... That shit was hilarabad.