Melt the butter in a large saucepan over medium heat. Add the garlic and cook for 30 seconds, then add the onion. Cook the onion until softened, about 3 minutes.
Pour in the tomatoes and use a large spoon to break them apart a bit. Add the beans, sun-dried tomatoes, tomato paste, salt, pepper, thyme, oregano, basil, rosemary, and bay leaves. Simmer for 20 minutes.
Cook the macaroni according to the package directions.
After the bean mixture is done simmering, remove the bay leaves, transfer 3 cups to a food processor, and puree until smooth. Pour the pureed mixture back into the saucepan, then add the cooked macaroni.