They stayed with the UK because in 2014, nobody knew that Cameron was going to call an EU referendum. Again, many comments I have heard, seen and read since then from Scots say that had they known the English (and Brexit IS overwhelmingly an English thing) were going take them out of the EU, then there is little doubt that they would have voted for independence.
I think they stayed in the Union because they know how much they financially depend on us