It wasn't "they," it was Theresa May who made the decision. Good judgment is not considered to be one of her strengths.
It is far from clear that Brexit will actually happen or that Trump will still be President if it happens. But either way, what Britain needs even more than American support is healing. This was not the way to go about it.
And, to go back to my first point, May should have realized that there was a real possibility that she would be forced out and that this might happen right when Trump was about to visit, as, in fact, it did. Neither she nor anyone in the Government is in any position to make meaningful headway on obtaining the kind of support sought.