Why is Kf8 the recommended move here? in this position: 

[FEN "rnbqk2r/pp2bppp/5n2/1Bpp4/8/3P1N2/PPP1QPPP/RNB1K2R b KQkq - 3 7"]


Stockfish 8 gives the move of Kf8, and claims my move of Bd7 is an inaccuracy. I don't quite understand why. I can see that it breaks the pin on my bishop on e7 and sets up for possible tactics with Qa5, but that's not going to happen against decent opposition and surely I'd rather my right to castle and connected rooks rather than my rook doing nothing on h8 and a somewhat weakened king.

Maybe this is just one of those positions where an engine gives moves too removed from human play to really comprehend?

Any help is appreciated, cheers.
sets up for possible tactics with Qa5, but that's not going to happen against decent opposition


Well, the Qa5+ tactics is exactly what's going to happen, and Black also threatens ...a6, ...b5 and ...c4 trapping the Bishop. It looks like White cannot avoid losing a piece, but he will only get a pawn and some light pressure in return.

[FEN "rnbqk2r/pp2bppp/5n2/1Bpp4/8/3P1N2/PPP1QPPP/RNB1K2R b KQkq - 3 7"]

1... Kf8 2. Ba4 {2. a4 doesn't help because of ...a6, trapping the bishop; 2. Nc3 fails to ...d4 and the bishop will again be unprotected} Qa5 3. Nc3 d4 4. O-O dxc3 5. Re1 Qd8 6. bxc3