2Heat oil in a large heavy wide pot over high heat; add ham, onion, and garlic. Cook, stirring often, until the onion caramelizes, about 5 minutes. Reduce the heat to low. Add ketchup, brown sugar, molasses, mustard, Worcestershire sauce, hot pepper sauce, red pepper flakes, and water to pot. Season with salt and pepper. Let the sauce simmer until slightly thickened, for 10 to 15 minutes. Stir the beans into the sauce.
3Cover and bake the beans until the juices are bubbly and thickened, about 2 hours.
4Meanwhile, place the bacon slices on a rimmed baking sheet. Roast in the oven until crisp, for 10 to 15 minutes. Place on paper towels to drain. Let the bacon cool and reserve 1 tbsp bacon drippings separately.
5Coarsely crumble the bacon; place in a food processor with reserved drippings and panko; pulse until the bacon is finely chopped. Season with salt and pepper.
6Remove the beans from the oven. Preheat the broiler. Sprinkle the beans with the bacon breadcrumbs. Broil, uncovered, until the crumbs are golden brown, 8-10 minutes.