Bring a large pot of water to a boil, salt it, cook pasta to just shy of al dente.
Chop pancetta into 1/4-inch dice.
While pasta cooks, heat a skillet with olive oil over medium to medium-high heat. Add pancetta, cook 2 to 3 minutes then add celery, carrot, onions, garlic, rosemary, thyme and bay leaf to the skillet, season with salt and pepper. Saute the vegetables until tender, 6 to 7 minutes. Add beans and heat them through. Stir in 1/2 cup wine, simmer 30 seconds more and turn off heat. Remove bay leaf.
While vegetables cook, place a small sauce pot over medium heat, add butter, melt butter then whisk in flour and cook 1 minute then whisk in milk. Season sauce with salt, pepper and nutmeg and reduce 4 to 5 minutes, stir in half the grated cheese, turn off heat and adjust seasoning.
While sauce cooks, place a rack in the middle of the oven and preheat broiler to high.
Drain pasta and return to the pot, toss with white bean mixture and sauce, stir to coat, transfer to a casserole dish, top with remaining cheese and place in oven to brown, 5 minutes.