In a medium skillet, heat 1 tablespoon of the oil over medium high heat, and cook the onion and garlic, stirring, until the onion softens, about 3 minutes.
Stir in the cumin, oregano, red pepper, tomatoes, and beans.
Transfer the mixture to a food processor and pulse 8 to 10 times to make a coarse purée.
In a large skillet, heat the remaining 2 tablespoons of oil over medium heat.
Add the bean mixture and bring to a boil, stirring constantly.
Turn the heat to low and cook, uncovered, stirring frequently, 6 to 8 minutes, or until the liquids have reduced and the beans are thick enough to hold a mounded shape on a wooden spoon.