The shitty deal is pragmatic for the EU, as it makes it obvious to all the countries involved that they can't get the benefits of the EU without being part of (and paying money into the governance of) the EU.
Clearly it wasn't that smart as it raises the chance of no deal, which would hurt the EU more than the UK. Barnier was certainly looking a bit frazzled today! Theresa May's mistake was to think she could negotiate with the EU in a civilised manner, when the only thing it understands is brutality.