The biggest reason magick sometimes fails, is because you were not able to step away from narrow-mindedness to believe, deep inside, that change is possible. This is, of course, not the only reason magick fails, but like I said, it is the biggest reason. Other reasons may be:
You lost your focus during the spell or ritual. If you're not focused, your magick will fail. To have focus, you must also be aware, prepared, and know your intent. These are important, and cannot be overlooked. You need to also make sure you are mentally and physicall healthy. These can make you lose your focus as well. Are you afraid you might get what you ask for? Do you think you don't deserve to be successful? Do you have self-esteem problems? If these answers are yes, then you are bound to fail.
You are being to impatient. Magick doesn't work in just the blink of an eye. For change to occur, magick must move freely, without any blocks in the way. Freeing the pathway can take time,sometimes even as much as a year! If you feel it's "taking too long," you can always help out your spellwork by doing it again at intervals, or doing something different with the same intent.
You received your wish, but it was so smooth and so quiet that you didn't realize it. Sometimes the situation changes in a way you hadn't wanted or thought it would. You got your change, but you were just too blind to notice. People often think it was just coincidence. But magick is subtle like that.
Magick that somehow touches groups of people takes longer than magick that is focused on a single item or person. When you energy coming or going to multiple people, your work doesn't have a straight shot to success. It has to change and move through blocks. Just keep working and it will be successful.
Magick cannot replace physical action. Sometimes, it's a lot easier to do things the "normal way." In my experience, magick is rarely needed for anything. Most anything can be done the "normal way" if you try hard enough. Stop being lazy and do some work once in a while.
The magick somehow interferes with your spiritual plan. If you have no spiritual plan, this will not affect your magick. If you do have a spiritual plan though, all the magick you've been doing prior to the failed magick may override it. If you've been working at making your life peaceful and positive, and then you curse someone you're angry at, the spell may not work because your spiritual plan doesn't agree with what you're doing.
All magick strives to create balance; therefore, sometimes a situation has to get worse before it gets better. This is one is pretty self-explanatory. Just keep in mind that your view of the situation may have to change before your work is completed.
Finally, sometimes shit happens. There may be no magickal reason you failed. Deal with it and move on. Try something else.
In conclusion, know that magick has everything to do with knowledge. But simply collecting knowledge isn't going to do you any good. It's the direction of your learning, the application of your knowledge, and understanding what you're doing that is going to make you successful. If you believe and practice, you will be successful. Remember, the key is to believe.