Did you rotate the levers repeatedly to get the very last bit of air out? Normally a very simple procedure:
1. Rotate lever to horizontal, unscrew reservoir top and fit shimano bleed pot full of fluid.
2. Unscrew free stroke screw as far as it goes.
3. Remove pads, push pistons back into caliper, fit bleed block to caliper.
4. Open bleed port and caliper and let fluid run down until you can clearly see new fluid coming out of caliper.
5. Close bleed port on caliper.
6. Rotate lever down to normal position and flick lever quickly and repeatedly until no bubbles come out.
7. Rotate lever up to horizontal and flick lever again until no bubbles come out in pot.
8. Rotate lever up to about 30 degrees above horizontal and do the flick thing again.
9. Keep rotating and flicking until you get no bubbles at all coming out.
10. Remove bleed port but dribble a bit of fluid into the reservoir so that it is super full. Put the screw back into the reservoir. Screw the free stroke adjuster all the way in. Remove the bleed block from your caliper. Clean everything up and refit pads.
11. A couple of pumps of the lever with your pads and wheel in, and you should be all good to go.