score:6
We have made one attempt for a family visit visa, using my grandfather as the sponsor. At that time, my wife and I were not married; we had only our daughter to prove our relationship. We got married while that first visa application was in process.
Here is the situation as I see it. As your visa was going through the approval process, your marital status changed.
This may have made your application invalid, which is why it was rejected.
As far as I am aware, as you are a EU citizen, the following would apply to you (and your family):
All Union citizens have the right to enter another Member State by virtue of having an identity card or valid passport. Under no circumstances can an entry or exit visa be required. Where the citizens concerned do not have travel documents, the host Member State must afford them every reasonable means in obtaining the requisite documents or having them sent.
Family members who do not have the nationality of a Member State enjoy the same rights as the citizen who they have accompanied. They may be subject to a short-stay visa requirement under Regulation (EC) No 539/2001. Residence permits will be deemed equivalent to short-stay visas.
Therefore, I suggest you immediately apply for a short stay visa for your wife and child to visit Spain. As you are now legally married (please make sure your marriage is registered at the UK mission as well), I do not see an issue here.