The king must not move to a square under attack by an enemy piece, no matter what, even if said attack is currently not allowed.
If the rule allowed exceptions like this, the logic would chase its own tail: If White is allowed to play Kxf4 - placing his king in danger of getting captured with the excuse that Black (supposedly) can't actually take it next move -, then by the same logic, Black should be allowed to play Bxf4, too - placing his king in danger of getting captured with the excuse that White cannot actually take it next move (because there is no next move as soon as White's king is captured)! But if Black is allowed to play Bxf4, then Kxf4 gets illegal again, because now the danger of recapture is real.
Thus, to avoid these headaches, White is not allowed to play Kxf4 in the first place.
There is only one simple rule to remember: Any move that lets your opponent to capture your king in the next turn is illegal.
By capturing the pawn you would let your opponent to capture your king in the next turn. Pinned situation of the bishop is not important as your opponent captures your king before you capture your opponents king.