Here's why:
* Solemn Warning negates the activation of a Spell/Trap Card.
* Ritual Summons are a Spell/Trap Card effect that is activated on the field.
Therefore, when a Ritual Summon is activated, Solemn Warning can be activated to negate the Spell/Trap effect and prevent the Ritual Summon from happening.
Keep in mind:
* Solemn Warning only affects the activation of the Ritual Spell. It does not stop the Ritual Summon itself once it has already resolved.
* Other cards might also be used to negate the summon of a Ritual Monster. For example, you could use "Solemn Judgment" to negate the summoning of a Ritual Monster if its attack is higher than your opponent's Life Points.