Put chickpeas in a bowl and cover with water by 1 inch and add a pinch of baking soda and a pinch of salt. Let soak overnight or at least 12 hours.
Put the bacalao (salt cod) in water to cover and let soak at least 12 hours changing the water at least 3 times.
Drain the chickpeas and rinse.
Reserve 1 of the garlic cloves and put the rest in a large pot along with the chickpeas, cover with water by 2 inches.
Peel and quarter one of the small onions and add it to the pot along with the bay leaf.
Heat to a boil and turn the heat down to medium low and cook for 2 1/2 hours adding more water if needed.
Drain and rinse the bacalao and chop into 1" cubes and add it to the pot and cook for 30 minutes more.
Meanwhile, chop the remaining onion and saute in the olive oil over low heat for 10 minutes until light golden brown.
Add the tomato and cook mashing the tomato to break up for 10 minutes more.
Stir in the flour and cook for two or three minutes.
Add the paprika and remove from heat.
When the mixture has cooled a bit process it in a blender or food processor until pureed.
Stir mixture into the chickpeas. Season to taste with salt.
Pound parsley and remaining peeled clove of garlic in a mortar or process in a food processor.
Mix in 1 tablespoon of liquid from the pot and then add mixture to the chickpeas.
Add the spinach and cook for 15 minutes more.