Surprisingly, there is no law declaring English the official language of the UK.
In fact, English is just the de facto official language of the UK, which means it is not legally sanctioned as official but spoken by the majority.
England and Scotland do not have any official languages. Northern Ireland’s official languages are English and Irish.
Loads of stuff in the UK is not set into law but rather into custom iirc. So instead of “because the law says so” they have a bunch of “because we’ve always done it this way”.