I think this is a very sensitive area that I am trying to assist you with, and I hope that if anything, you will take this away from my answer: talk to someone about this, your parents, a counselor at school, or your doctor.
Being lonely sometimes, is normal, we all have our ups and downs, but to feel that you are a bad person, I think is taking it a bit too far, and I am worried about you. Being lonely usually translates into feeling depressed or unhappy, and sometimes it is out of our control, nothing you can do to change that, so you need someone else to help you.
Please, please, please talk to someone about this, someone who you sit in front of, not over the internet.