There can be a connection to your spritual/psychic development and nightmares, since you have gone a step forward in success with AP (astral projection). "Some studies show that people who are more sensitive, intuitive, creative, or imaginative are more prone to have nightmares. This may be because they are more empathetic and more in tune with their surroundings." Usually spiritual development causes someone to become more in tune with the Univers, more intuitive, etc. For example, the brow chakra makes you more intuitive and creative.
Source of quote:
Some causes also may be if you do not have good mental health or if you have taken any kind of drug as a "spiritual short cut" because they disable your reality filter and you absorb anything, which is a great chance for bad energy to get into your head. The long way helps prevent that bad energy because you will have more control.
Also your chakras can be out of balance. For example my brow chakra was once overactive and I had night terrors (not a typo for nightmares). Here is a great site that has great information on balancing them:
(this link is a chakra test)