When asking for help it helps us to figure out the problem by giving more info such as. How you got the horse and where you are trying to spawn it and what happens when you try and spawn (text coming up?).
I had this problem too, just give yourself build flag and you should be able to use spawn eggs Edit: What Kman said