Preheat the oven to 350o F and lightly grease a 9- by 13-inch baking dish.
To make the gratin, heat olive oil in a large, deep-sided skillet over medium heat. Add onions, garlic, and a pinch of salt, and cook, stirring frequently, for 15 to 20 minutes, until the onions are soft and starting to brown. Sprinkle over the flour, and stir to coat the flour with oil. Add the sherry and cook for a minute or two, until the liquid has reduced and thickened. Add vegetable broth and bring to a simmer; let cook for 3 to 5 minutes, until the liquid has thickened to a gravy-like consistency.
Turn off the heat and stir in chickpeas and spinach, letting the spinach wilt from the heat of the pan. Taste and add salt and pepper as needed. Transfer the mixture to the prepared baking dish.
To make the breadcrumbs, in a food processor, combine the olive oil, garlic, paprika, and a pinch of salt and pepper, and pulse until the garlic is finely chopped. Add the rye bread, and pulse until it forms coarse breadcrumbs. Sprinkle the breadcrumbs evenly over the top of the gratin. Bake for 35 to 40 minutes, until the top is deeply browned and the gratin is bubbling and fragrant.
Remove the gratin from the oven and let it sit for 5 to 10 minutes before serving. Serve warm. Leftovers will keep in an airtight container in the fridge for 3 to 4 days.