Very good question! This illustrates a deeper conflict between chess "principles" and "practice"
I have learned the bishop pair is worth a half pawn
Very dangerous piece of advice here! That is true in certain spots, I'd say most, but definitely not all the time. Piece activity, pawn structure, king exposure and many other factors can determine whether the bishop pair is an advantage or not.
By the way, what on Earth does "half a pawn" even mean? It's just a heuristic used by computers. There are no half-pawns in chess!
Pawn structure can definiely be a factor to consider. Indeed, knights often operate better in positions with a lot of weak squares, but let's take a look at a couple of different examples
1. e4 e6 2. d4 d5 3.e5 c5 4.c3 Nc6 5.Nf3
In this position, Black would be very happy if he could trade his light-square bishop for an opponent's knight because it is a pretty bad piece, even with no improvement in the pawn structure! Indeed, some players have even tried
4...b6 with the idea of
...Ba6. You can even see manoeuvres like
...Bd7-b5 (not in the mainlines, but that's because White does not allow that to happen)
The fact that, in general, the bishop pair is an advantage is an irrelevant consideration here. Games are not won with abstractions, but with concrete moves on concrete positions.
1. e4 c5 2.Nf3 Nc6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 e5 6.Ndb5 d6 7.Bg5 a6 8.Na3 b5 9.Nd5 Be7 10.Bxf6!
Here White trades his bishop without any pawn structure gain, and the bishop wasn't even that bad! But the control of the d5 square is critical here, so it's definitely worth losing the bishop pair!