Olympic medalist Louis Smith was given a two-month ban by British Gymnastics for appearing to mock Islam.