Its common sense to know no boss in this earth will encourage their employee to earn side income even out of office hour. Some more they will think u as a employer who is not loyal to company. Sad for u because your HR stalked you. But on the other hand , luckily this is only a warning letter. Means company just want to set the right expectation to you. Next time be careful when playing around on grey area.
Some of organization are not allow their employee to do side income. They will come up with the policy and/or stated in the offer letter. You need to check again their policy and your offer letter. What actually stated about side income. If doesn't have, ask your HR team to provide proof of side income policy. You also have power to get further advise from Labour Office.