The gelling you observed could be due to both the "Trommsdorff effect" and the small amount of di-methacrylate you normally find in HEMA.
Add a transfer agent to reduce the "Trommsdorff gelling", or better yet control the polymerisation via RAFT or ATRP.
Distil the monomer under reduced pressure to remove some of the di-methacrylate. Or if you require only a small amount, try and separate on a chromatography column.