SdFat initialization blocks HC-SR04
Pin 10 is the SS pin for SPI. Since you are using SPI for the SD card pin 10 must be an output (for SPI to operate in master mode). Ideally you will use that pin as the SS (or CS, whatever you want to call it) for the SD card.

You can't use it as the echo input of an ultrasound range finder and use SPI.