By paying troops and law enforcement officials, the president stretched the limits of his spending powers, posing a fresh test to Congress.