Pat the cod fillet dry and season both sides with salt and pepper. Drain the white beans and dice the tomato; mince the garlic finely.
Heat half of the olive oil in a shallow pan and briefly sauté the garlic. Add the tomato and white beans and let simmer for a few minutes, then fold in the spinach until wilted and season with salt and pepper.
Heat the remaining oil in a separate skillet and fry the cod three to four minutes per side until the fish is opaque and flakes easily. Place the fish on the bean-spinach mixture and squeeze some lemon juice over it just before serving.