Maybe a bit of perspective is necessary. How many Muslims actually took part in the murderous violence against Charlie Hebdo and against that teacher?
Compared to the million or so Muslims in France, significantly less than one percent of one percent...
...but it's that vanishingly-small percentage that gets the headlines, isn't it?
As to your question, "Is it immoral to do that which someone else finds offensive?"
Is it immoral to ridicule someone for their race, or to claim that atrocities never happened, even when there are people alive today who remember those atrocities?
Of course such is immoral.
Now consider that for most people who are truly religious, the religion is *much more* important than race. That's why it's not unusual to see Black Christians, White Buddhists, and Chinese Muslims.
Is the cost of refraining from publishing a cartoon that *is* deeply offensive really too high a price to pay?
As to your other examples, have Muslims in France - or in any other nation outside majority-Muslim nations - demanded that women cover their hair, or outlawing the eating of pork?
Here's an anecdote my youngest son told me about. He was attending a Christian high school in Manila, Philippines. He saw a friend of his who happened to be Muslim, and the friend was eating pork BBQ. My son said, "Hey, isn't that against your religion?" His friend replied, "That beer you're drinking right now - isn't that against Christianity?" They both laughed.
Personally, I've seen a Muslim - dressed in the flowing robes and all - drinking beer in Dubai. I also spent two hours in a "Safest Way" - their supermarket - looking for *anything* that had even the least bit of pork or pork fat in it...and there was nothing.
But I digress. The point is, we shouldn't be blaming a million French Muslims for the actions of a very, very few...and politeness, courtesy, and refraining from publishing a silly cartoon costs nothing except in the perception of those too prideful to give such consideration to others.