Preheat oven to 400°.
Combine first 4 ingredients in a large saucepan over medium heat; bring to a boil, stirring constantly. Reduce heat; simmer 10 minutes, stirring frequently. Remove from heat, and let stand 10 minutes. Drain potatoes over a bowl, reserving 1 cup milk mixture. Discard thyme sprigs.
Cook carrots in boiling water for 2 minutes or until crisp-tender. Rinse in cold water; drain.
Arrange half of potatoes in bottom of a 13 x 9-inch baking dish coated with cooking spray. Arrange carrots and ham over potatoes. Sprinkle with half of cheese, salt, and pepper. Top with remaining potatoes. Sprinkle with remaining cheese, salt, and pepper. Stir nutmeg into reserved milk mixture; pour over potatoes.
Cover with foil; cut 3 (1-inch) slits in foil. Bake at 400° for 20 minutes. Uncover and bake an additional 20 minutes or until cheese begins to brown. Let stand 10 minutes before serving.