Why is Bf5 good in this position? I would like to know why playing Bf5, allowing White to exchange the white-squared bishops, doubling Black's pawns is good for Black.

In such situation, castling on either side seems quite unsafe for Black given its weaknesses of b6, h6 and probably f6 later on.

Plus, I am not sure eliminating the White bishop is a good reason, as it is not particularly dangerous in such a position.
After the exchange of white squared bishops black will play e6 cementing the center, leaving all his pawns on white squares. The white squared bishop is Black's bad piece in these structures and conversely it is white's best piece. The exchange very much favours black.

With black pawns on d5 and f5 white isn't going to be opening the center any time soon so the black king is safe in the center. Black has at least equalised.