The department called its social media post “offensive and inappropriate” and said it was investigating how it had been published.