Assume you are trying to test the effect of condition X. You sample people randomly and put them in a manipulation group (condition X) and a control group (condition Y). Simultaneously you want to control for another variable, say gender, so you measure gender, and then when you compare the manipulation group to the control group you control for the gender variable (e.g. through including it in an ANCOVA or a regression).
Is it correct to control for gender in this way, or is it unnecessary, since the sample is random?