The reference numbers are used to group admission application forms so that it will be easy for the admission officers to review and admit student. That is why they tell you to write the reference number on the back so that they can arrange and review the applications with easy.
Even though you did not write it, it is not a very serious mistake. It will only make the admission Officers a little annoyed. They will not reject your application because of you did not write the number on the EMS envelope.
Any time you are doing anything like filling a form, always read the instructions given or ask someone who knows the instructions so that you can follow it.
UDS instructions for filling their forms are here, read it carefully http://admissions.udscampusmanager.com/