Because the aptitude test is just a preliminary to sort out the candidates the company is genuinely interested in and would like to meet formally to discuss the job. The candidates will (or should be) judged totally on how they perform in the exam and their clothes have nothing to do with the process.
That may be how it works in theory, but not in practice. People from the HR/Personnel Dept will be there checking people in and out and administering the aptitude test itself. Trust me, they notice those who show up in suits/business casual dress versus those in shorts, torn jeans and flip flops. The stated dress code may tell you to dress for comfort, but they are looking out for people who have the kop on to be able to read between the lines and know the difference between showing up relatively well dressed, versus showing up looking like a Britney Spears/Wayne Rooney wannabe. In the job seeking process, being judged by your abilities alone is a wonderful utopian idea of idealism, but at the beginning of the process, appearances count for A LOT imo.