There are many reasons why you might be sore. Since the soreness seems like a surprise to you, I would assume that there is actually more than one cause for your soreness.
1. Soreness is normal. It is normal to be a little sore after any strenuous activity. It indicates that you actually pushed your body and that your body is recovering. That being said...
2. You overworked your muscles. This is the most likely cause of your soreness. You probably pushed yourself too hard, too fast. This is an easy mistake to make.
3. Improper form. There are a lot of people who lift weights that have very poor form. This leads to injuries and chronic pain. You should always use proper form. This means full range of motion, no jerky motions, and not using momentum.
4. Dehydration and/or improper nutrition. Water is important, and most people don't drink enough. If you are starting a new workout program, you probably need to also increase you water intake. This also applies to nutrition. You need to adjust your diet according to your new workout. Depending on what you are lifting for, this could mean increasing you protein consumption.
5. You aren't stretching (enough). So many gym rats do not stretch properly, if at all. Supplementing you lifting with some sort of stretching regiment will help you prevent undue soreness.