Well that kind of depends who you ask, but.... No, it was an air services agreement signed between 2 sovereign nations so there was nothing illegal about it when it was signed. Many air services agreements have had restrictions on them of some sort or another, be it number of flights, number of carriers, etc. BII may be particularly restrictive regarding LHR
access but that in itself does not make it illegal.
Since then, however, the world has moved on and the European Union has effectively ruled that individual air services agreements between EU states and the US (and other countries I guess) are illegal under European law. However until there is a re-negotiation of BII then it is the legal agreement that stands.
This is where things start to get rather murky in the realm of EU politics and law and the theoretical pooling of jurisdiction and the rights of individual states. At which point I am probably already WAAAY out of my depth and will bow out to those with greater expertise than me....