Preheat the oven to 350°. Coat a large gratin pan or baking dish with olive oil.
In a heavy saucepan over medium heat, combine 1 tablespoon olive oil and pancetta or bacon. Cook, stirring frequently, until the meat begins to render its fat, about 5 minutes. Add onion and garlic, stir to coat, and saute about 5 minutes. Add the beans, rosemary, and bay leaf, plus enough water to cover by about 1 inch. Partially cover and bring to a simmer. Season with salt and pepper. Remove the rosemary sprigs and the bay leaf from the beans. Stir in the tomatoes. Taste for salt and pepper. Spread the beans into the prepared dish. Sprinkle the top with the bread crumbs and cheese. Drizzle generously with olive oil. Bake until heated through and beginning to brown on top, about 30 minutes. For a crunchy topping, run the gratin under the broiler for a few minutes just before serving. Serve hot or warm.