Heat a small nonstick skillet coated with cooking spray over medium-high heat. Add onions, ham, and garlic; sauté 5 minutes. Remove from heat; cool.
Preheat oven to 350°.
Arrange bread cubes on a baking sheet. Bake at 350° for 15 minutes or until lightly browned, turning occasionally.
Combine milk and next 5 ingredients (milk through nutmeg) in a large bowl, stirring with a whisk until well blended. Stir in ham mixture. Add bread, tossing gently to coat.
Arrange half of bread mixture in an 8-inch square baking dish coated with cooking spray. Sprinkle with half of cheese; top with remaining bread mixture. Bake at 350° for 25 minutes. Sprinkle with remaining cheese; bake an additional 20 minutes or until set.