I got extreme shoulder pain after finishing a set of bench presses, what could I have done?

Labral injury. You can injure yourself if you exceed the physiologic limits of your shoulder because of muscle fatique or poor mechanics. A sharp pain can be caused by a torn labrum (the fibous ring that keeps the shoulder in place), impingement, rotator cuff tear, or muscle strain. A sharp pain can be a sign of injury or can lead to an injury, so to be safe you should always do the bench press with a spotter.
?Rotator cuff. You are clearly doing too much, and probably the problem is the weight rather than the number of reps. You may be irritating and damaging the muscles of the rotator cuff or may be causing a tendonitis/bursitis of any of the structures about the shoulder, including the biceps tendon, subacromial bursa, but it is probably the rotator cuff.