First of all, I am a single mother of three. Two of my daughters are now grown and in college. The third is now in sixth grade. While I believe that every child is different, I believe that there are some things about children that will never change. All children will go through periods of rebellion. I can tell by your description of your daughter that your response is going to be that she is not rebellious, but merely acting in a compassionate way towards this boy, however, rebellion can manifest itself in many forms and most of these ways appear non-threatening or benign on the surface. The mere fact that she has continually disobeyed your initial request to avoid this young man is an indication of a rebellious spirit, because she is in effect telling you that she knows, better than you, who she should or shouldn't hang out with. While this situation short-circuited on it's own, the fact that it made it to the point that it did, particularly since she is only nine, indicates to me that she is indeed strong-willed enough that if left unchecked, this sort of thing will not only repeat itself but get worse.
In my house, my older children rarely went anywhere unsupervised and any disobedience was swiftly and severely punished. Yes I did and do (the youngest) whip them and today I would tell anyone who disagrees with me that they are not only well-adjusted, but they are grateful for the strict discipline they received. That discipline drove rebellion out of my children and kept my older daughters on track and in school. In fact one of them just received a promotion on her job. She is the only college aged employee who has been made a supervisor. In reviewing her work performance, they consistently remarked on how disciplined and focused she has been. When asked, she told them, "Having been raised in my mama's house, I had no choice but to be disciplined. My mama doesn't play!"
I have said all of this to say, you must confront this issue with your daughter and she must be punished for her actions. While I will not tell you that you need to spank her, I will tell you that the method you choose needs to be swift and should fit the severity of what she has done. Let your daughter know that while you applaud her sensitive nature and caring heart, it is your job as parents, to shape that nature and guard that heart, until she learns to make wise decisions on her own. Let her know, of course, that your main concern is that she could have been seriously injured or even killed as a result of this escapade, and that you don't want to see her become a victim of the harsh realities that are out there for runaways. Talk to a counselor at school and see if there are videos about runaway kids or other resources that you all can sit down watch together. This could be a great way to make her think about all of the things that she didn't think about before sneaking out. Pure fear stopped them this time. Next time it may not be enough. I will be praying for you and your daughter... God bless you.