Based on that Gemara it appears that there are two opinions regarding whether King David erred or not. According to the opinion that he did err, this shortcoming was the cause of the split in the kingdom and the ultimate exile while according to the opinion that he did not err the split in the kingdom must be attributed to some other cause.
Based on Kings 11:11-13 it seems that the simple understanding is that King Solomon sinned (or erred in some way) and therefore deserved to have the Kingdom completely taken away from him. However, because of the honor due to King David, God did not remove the kingdom from King Solomon but rather from his son. Additionally, because of the merit of King David and Jerusalem Solomon's descendants would be left one tribe - Judah.