There is not much of a problem .
Alakazam is a pokemon with killer speed and sp.attack and horrible defences .
Added to that you Unknowingly have battled pokemon that ev. yield Stats other than defence and sp.defence .
If you want to gain more defence and sp.defence then figure out what stat has gained more comparatively points other than speed and sp.attack cause they are meant to be high , then goto this page
Use ev reducing berries on that stat which you wanna reduce and battle pokemon from the defence and sp.defence list to gain stat points in those stats .