As already said, controlling usually means including a variable in a regression (as pointed out by @EMS, this doesn't guarantee any success in achieving this, he links to this). There exist already some highly voted questions and answers on this topic, such as:
The accepted answers on these questions are all very good treatments of the question you are asking within an observational (I would say correlational) framework, more such questions can be found here.
However, you are asking your question specifically within an experimental or ANOVA framework, some more thoughts on this topic can be given.
Within an experimental framework you control for a variable by randomizing individuals (or other units of observation) on the different experimental conditions. The underlying assumption is that as a consequence the only difference between the conditions is the experimental treatment. When correctly randomizing (i.e., each individual has the same chance to be in each condition) this is a reasonable assumption. Furthermore, only randomization allows you to draw causal inferences from your observation as this is the only way to make sure that not other factors are responsible for your results.
However, it can also be necessary to control for variables within an experimental framework, namely when there is another known factor that also affects that dependent variable. To enhance statistical power and can then be a good idea to control for this variable. The usual statistical procedure used for this is analysis of covariance (ANCOVA), which basically also just adds the variable to the model.
Now comes the crux: For ANCOVA to be reasonable, it is absolutely crucial that the assignment to the groups is random and that the covariate for which it is controlled is not correlated with the grouping variable.
This is unfortunately often ignored leading to uninterpretable results. A really readable introduction to this exact issue (i.e., when to use ANCOVA or not) is given by Miller & Chapman (2001):
Despite numerous technical treatments in many venues, analysis of
covariance (ANCOVA) remains a widely misused approach to dealing with
substantive group differences on potential covariates, particularly in
psychopathology research. Published articles reach unfounded
conclusions, and some statistics texts neglect the issue. The problem
with ANCOVA in such cases is reviewed. In many cases, there is no
means of achieving the superficially appealing goal of "correcting" or
"controlling for" real group differences on a potential covariate. In
hopes of curtailing misuse of ANCOVA and promoting appropriate use, a
nontechnical discussion is provided, emphasizing a substantive
confound rarely articulated in textbooks and other general
presentations, to complement the mathematical critiques already
available. Some alternatives are discussed for contexts in which
ANCOVA is inappropriate or questionable.
Miller, G. A., & Chapman, J. P. (2001). Misunderstanding analysis of covariance. Journal of Abnormal Psychology, 110(1), 40–48. doi:10.1037/0021-843X.110.1.40
From a frequentist perspective, an unadjusted comparison based on the permutation distribution can always be justified following a (properly) randomized study. A similar justification can be made for inference based on common parametric distributions (e.g., the $t$ distribution or $F$ distribution) due to their similarity to the permutation distribution. In fact, adjusting for covariates—when they are selected based on post-hoc analyses—actually risks inflating the Type I error. Note that this justification has nothing to do with the degree of balance in the observed sample, or with the size of the sample (except that for small samples the permutation distribution will be more discrete, and less well approximated by the $t$ or $F$ distributions).
That said, many people are aware that adjusting for covariates can increase precision in the linear model. Specifically, adjusting for covariates increases the precision of the estimated treatment effect when they are predictive of the outcome and not correlated with the treatment variable (as is true in the case of a randomized study). What is less well known, however, is that this does not automatically carry over to non-linear models. For example, Robinson and Jewell [1] show that in the case of logistic regression, controlling for covariates reduces the precision of the estimated treatment effect, even when they are predictive of the outcome. However, because the estimated treatment effect is also larger in the adjusted model, controlling for covariates predictive of the outcome does increase efficiency when testing the null hypothesis of no treatment effect following a randomized study.
[1] L. D. Robinson and N. P. Jewell. Some surprising results about covariate adjustment in logistic regression models. International Statistical Review, 58(2):227–40, 1991.
Best Answer
With random allocation to treatment and control groups, and as your sample size increases, it should become increasingly unnecessary to control for any covariates. However, if chance results in an unusually disproportionate number of females in one of your groups, it's certainly not wrong to control for gender in your analysis. But you will likely need to make it clear why you did control for it and others, or it and not others, by describing the characteristics of each group clearly.