Try to check inputs and normalise as soon as possible, then you can safely use the first option.
If your user interface allows the input to this variable to be anything (e.g. a text box), then in your example, you could get "M", "Male", "Man", "Boy" or "Männlich" as possible honest inputs for male, before even considering that someone might proffer a stupid answer. By checking (and normalising) these values before you need to use them, you can offer more responsive feedback to the user.
If your user interface constrains this to a radio button, then it is normalised even earlier.
If the value is fetched from some kind of data store, then, depending on the application, and your knowledge of the integrity of that datastore, there may or may not be any value in checking the validity of the record prior to acting upon the values held within.
If most records are likely to conform, and the actions that various values invoke are cheap and reversible, I'd use the second option, and throw an exception if a value is inappropriate.