Hi,
Fortunately there a many water fountains at the airport. They located next to (most of) the toilets. But it also depends on the terminal.
At T4 (Iberia, British Airways, and other other One World airlines), they at the toilets next to the gates passed the shops. I am not sure about the rest of the terminals.
Tip if you are visiting Madrid, in the city center there a some drinking water public fountains. They are not that visible, but they exists. For example in the boulevards in Sainz de Baranda st. and Ibiza st. at the East side of the park.
#plasticfree @aena