The problem with your attitude is that, by definition, free speech is only a useful right when it protects unpopular speech. The law at hand here isn't a surprise (the UK hasn't got free speech as an enshrined right), but it is certainly a particularly glaring red flag that there is absolutely nothing stopping them from e.g. passing a nearly-identical law copying Thailand about the royal family and putting in prison anyone who calls Prince Andrew a pedophile.
The vast majority of important free speech cases throughout history have involved the most deplorable people making the most deplorable kinds of speech, but e.g. American free speech would be nonexistent if the KKK hadn't won their landmark case.
That would be bad enough if they didn't then also advocate incarcerating people for disagreeing with them.
I think Denolition Man should be required viewing for any conversation about good vs bad laws. It's worrying how few people seem to be aware of the ideas in that movie.