I haven't looked at your code, but when a microSD module and another SPI device both work separately, but not together, it's usually because the typical microSD module doesn't release the MISO line properly when its CS line is not active. If your SD module looks like the attached pic, that's probably the problem. The pic also shows the solution.

