A few issues are immediately noticeable. You're invoking the <<print>> macro unnecessarily in several places, you cannot break up markup as you're attempting with the <table>, and you should be using a temporary variable for your loop index (i.e. _i versus $i).
Try something like the following:
Currently you have <<print $NPCGender.length>> generated characters
<<for _i = 0; _i < $NPCGender.length; _i++>>\
Name: \
<<if $NPCGender[_i] lte 3>>/* is Male */\
<<print $MFNameList[$Firstname[_i]]>>, Nickname: <<print $MNNameList[$Nickname[_i]]>>\
<<else>>/* is Female */\
<<print $FFNameList[$Firstname[_i]]>>, Nickname: <<print $FNNameList[$Nickname[_i]]>>\
<</if>>, Gender: <<print $GenderList[$NPCGender[_i]]>>
<</for>>