Preheat the oven to 400°F with a rack in the center position.
Melt the butter in a large ovenproof skillet or braising pan over medium heat. Once the butter is bubbling, add the garlic and anchovies. Cook, stirring to break up the anchovies, until fragrant 1 to 2 minutes.
Stir in the wine and cook until slightly reduced, about 4 minutes. Add the tomatoes, oregano, and thyme. Bring the sauce to a simmer. Cook, stirring occasionally, for about 10 minutes, or until the tomatoes are broken down and the sauce begins to thicken. Stir in the olives and capers.
Season the fish with salt. Add it to the skillet with the sauce. Transfer the skillet to the oven and cook until the fish is opaque and flakes easily with a fork, 8-10 minutes. See Note. Remove from the oven.
Divide the fish among 4 plates. Spoon the sauce over the fish and sprinkle with basil and red pepper flakes, if using. Serve with garlic bread on the side if desired.