You're right, it doesn't matter what gender you are. The imbalance of the genders in engineering is pretty skewed and we want to improve that. We think a women exclusive fellowship is a great start.
So, no, it is not illegal and I don't see too many "women exclusive" scholarships being mentioned here.
The American Physical Society and IBM co-sponsor a research internship program for undergraduate women. The goal is to encourage women students to pursue graduate studies in science and engineering. -- http://www.aps.org/programs/women/scholarships/ibm/index.cfm