Ofcom has accused the BBC of “a serious breach” of the broadcasting Code with its Gaza documentary for its Hamas links.