I assume you are asking because you are a citizen of the UK. If this is not correct, please post a comment.
If your wife is a Spanish citizen, she can of course move to Spain at any time, and so can you.
The EU free movement directive specifies that (close) family of EU citizens, including spouses, also enjoy freedom of movement when accompanying the EU citizen principal. The directive does not require countries to extend similar rights to the family members of their own citizens, but it does not prevent it, either. Spain does extend such rights to the family of its citizens, so you could move to Spain with your wife regardless of your own nationality.
If you move to Spain while UK citizens still qualify for freedom of movement in their own right, you will probably be able to stay after the end of free movement for UK citizens under some sort of "grandfather clause." The precise arrangements have not yet been determined, of course, and their nature will depend on whether the UK leaves the EU with or without an agreement.
Given the large number of British retirees and other expatriates in Spain, it is highly likely that Spain would create a mechanism to allow them to stay even if the EU does not pass any laws to require this. But, once again, your wife's Spanish nationality will mean that you do not have to rely on this.
Still, it may be better for you to move to Spain in your own right if you can, because if you do it could be simpler for you to remain in Spain if your marriage ends. (There are provisions for the derivative right free movement to persist after the end of a marriage, but they could impose an additional bureaucratic burden on you to prove that you qualify.)
If you are asking about health care, retirement benefits, and the like, I do not know how the departure of the EU will affect this. It will probably be some time before it is clear.