Oliver Ryan, who was elected to represent the Burnley constituency last summer, had been under investigation over the remarks.