By doing it this way, she was able to reach a lot of people. She probably wouldn't be allowed to speak again at a major venue like this if she had mentioned Islam. That's not right, of course, but that's the way it is until far more people are acquainted with the disturbing nature of Islamic ideology.
To those of us who have learned about Islam, Madonna was forcefully criticizing Islam in her speech. To everyone else, she was criticizing cruelty and injustice. The end result is essentially the same.
She was speaking at the Chime for Change concert, which raised more than four million dollars before it even took place. Imagine what would happen if we all got behind the goal of education for girls in places like Pakistan and Afghanistan. What would happen? Orthodox Muslims would try to stop it, of course. They are already trying, and their brutal hands are covered in the blood of innocent girls.
But in the context of this completely positive goal (educating girls) those brutal actions (motivated by orthodox Islam) outrage almost everyone. Think about what happened when Malala Yousafzai was shot by the Taliban for going to school. She was on the cover of Time Magazine! It made people aware of the situation — the kind of people we've had difficulty reaching — and motivated them to do something about it.
People will be outraged by the brutal actions of orthodox Muslims and will demand some way to make sure those innocent girls are not killed or burned with acid for simply wanting to go to school! At that point, we have them on our side rather than unwittingly on the enemy's side. They will be pushing for the same changes we are pushing for (because enabling girls to get an education simultaneously marginalizes, discredits, and disempowers orthodox Islam).
When people don't like us talking about Islam, it's usually because they think of Muslims as persecuted minority underdogs. They don't like to see the weak trampled on by the strong. A great majority of people in the world have a strong revulsion to the powerful crushing the powerless. So when we cast the issue as weak girls being oppressed, injured and killed by armed fundamentalist Islamic men, we use that strong revulsion for good instead of evil. Think about it.