First and foremost, the Students' Association of St Andrews is charity (registered Scottish charity SC019883). This means that societies are subject to various stipulations.
But most importantly, it is important to note that societies can hold fundraisers for charities (if it is in their constitutions to do so), but only profit generated from such events can be donated. It is illegal for one charity to pass money directly to another.
e.g. the Union gives you £100 to put on a ceilidh. Ticket sales from the ceilidh were £150. Only £50 can be given to a charity (as this was your profit).