Please provide links to the hardware used and edit your post and include code tags to make the code readable.
My guess is that your two devices need the SPI bus reconfigured before every access to them because the don't use the same SPI mode. I couldn't find a datasheet for the DS3237 though, is that really the correct part number?