I remember reading a while back (so don't take it as gospel) that, for Australia at least, legal tender meant that if you have a debt owed for something, legally that person has to allow you to settle the debt with legal tender currency.
However there is nothing that says they have to accept the transaction to begin with, meaning they were allowed to have a rule like this because if you didn't accept it, they just didn't sell to you, which means there was no debt accrued that you could settle with legal tender. And if you did accept it, you've already paid with your card, so no need for cash.
Don't know if the same logic applies in Europe but I wouldn't be surprised if it's a similar justification. They have to accept legal tender for a debt, but they don't have to allow the debt to be incurred.