Preheat oven to 350°.
Combine first 4 ingredients, stirring with a whisk; set aside.
Heat butter in a medium saucepan over medium heat. Add onion; cook 3 minutes or until tender, stirring frequently. Stir in milk mixture; bring to a boil. Cook for 2 minutes, stirring constantly. Remove from heat; add 1/2 cup cheese, stirring until smooth.
Arrange half of potatoes in an 11 x 7-inch baking dish coated with cooking spray. Pour half of sauce over potatoes; top evenly with ham. Top with remaining potatoes and remaining sauce; sprinkle evenly with remaining 1/2 cup cheese.
Cover with foil coated with cooking spray. Bake at 350° for 40 minutes. Uncover and bake an additional 45 minutes or until potatoes are tender and the cheese is golden brown. Remove from oven; let stand 5 minutes before serving.