The question you have is easy to answer but will not help you when you handle generic fasta files. Fasta files have a sequence header followed by one or multiple lines which can be concatenated to represent the sequence. The Fasta file-format roughly obeys the following rules:
The description line (defline) or header/identifier line, which begins with character (>), gives a name and/or a unique identifier for the sequence, and may also contain additional information.
Following the description line is the actual sequence itself in a standard one-letter character string. Anything other than a valid character would be ignored (including spaces, tabulators, asterisks, etc...).
The sequence can span multiple lines.
A multiple sequence FASTA format would be obtained by concatenating several single sequence FASTA files in a common file, generally by leaving an empty line in between two subsequent sequences.
To answer the OP's question, If you just want to process every second line, you want to do:
awk '!(NR%2){gsub(/[^CTAG]/, "N")}1' file.fasta
This method will, however, fail on any of the following cases:
fasta file with a multi-line sequence
multi-fasta file with a possible blank-line between subsequent sequences
A better way would be to exclude the header line and process all other lines:
awk '!/^>/{gsub(/[^CTAG]/, "N")}1' file.fasta