Preheat oven to 350 degrees. Spray a 2 quart casserole dish with cooking spray and set aside.
In a medium saucepan, melt butter over a medium heat. Add garlic and cook until soft and fragrant, about 1-2 minutes.
Whisk in flour. Cook 1 minute. Slowly whisk in milk. Add salt. Bring to a boil and reduce to a simmer until thickened, about 3-4 minutes. Remove from heat and whisk in pumpkin puree. Season to taste with salt and pepper.
Layer half of the potatoes in the bottom of the prepared dish, cover with half of the sauce,spreading it with a spoon or spatula to evenly cover the potatoes. Sprinkle half of the cheese on top. Repeat for next layer.
Place in oven and cook until potatoes are fork tender and top is golden brown, about 1 hr. If the top is browning too quickly,you can cover with foil and remove a few minutes before the potatoes are done cooking.