Two of the Persian Gulf’s richest monarchies pledged $8 billion in cash and loans to Egypt on Tuesday, a decision that was aimed not only at shoring up a shaky transitional government, but also at undermining their Islamist rivals and strengthening their allies across a newly turbulent Middle East.