Are rotor bolts designed to shear? I was toying about with a disk brake for the first time and managed to shear two bolts clean off while reassembling.

Curiously, both tore the head off, leaving the threadded shaft in the tapped hole in the hub.  I was able to remove the shaft using bull-nosed pliers both times.

Looking closely at the remains, the head has torn off where it fastens to the shaft.  Is this a weak point by design?

No, I was not using a torque wrench, because I don't own one.  This is high on my list of wants though.
Low-profile button-cap socket screws do have a design weakness. The button reduces the amount of material around the head and the recessed hex or Torx socket also does the same, exactly at the interface of the screw body and head. 
In this zoomed in portion of your larger photo, you can see just how little material connects the head to the rest of the screw:



You have to be careful with following the torque recommendations with low-profile heads, especially if you're using a torx bit in a regular socket wrench. As a side note, this is a great guide for bike component torque specs. Rotor bolts shouldn't be overtorqued -- and need to be torqued to the same amount -- to prevent the rotor being warped.

Two things you can do:


Torque wrenches are cheap and you should have two: one low-range (&lt;11 Nm) and one high range (20-6 0Nm).  Beam-type torque wrenches are more accurate than uncalibrated, cheap clicker-type torque wrenches. In terms of the low range, many automotive torque wrenches don't read low enough for bike componentry, especially carbon frames. Brake rotors are supposed to be torqued only to 6.2 Nm for Avid, 2-4 Nm for Shimano. This is a cheap US$25 wrench that goes from 2 to 10 Nm (88 in/lb, you have to do the imperial correction manually). It's great for the smaller components on bicycles or for carbon frames. I used it for my own recent disc brake upgrade. 

 
If you can  find a Torx or hex screw where the threads don't go up all the way to the head, it's a bit stronger. But you have to be careful that this doesn't limit the depth of material that is being retained. Disc brake rotors I believe are 1.6~1.8mm thick when new so you should only have about 1.25~1.5 mm of unthreaded shank. This one is too long:




Note that you may not be at fault. The drunken lemur who initially assembled your hub and rotor might have applied too much torque at the factory, fatally weakening the screw. So when you redid the brakes, you were working with a weakened component.



As an addendum, even though button cap screw heads are inherently weak, the zoomed-in photo at the top and here seems a bit extreme in just how little material there is -- the torx socket seems recessed even further than normal. So don't rule out a manufacturing defect in the screws themselves... although one also shouldn't rule out that it may be a design feature and not a bug -- designed to prevent you from overtorquing the rotor bolts and warping the rotor.