Needle insertion is a common procedure in percutaneous puncture. A motion planner for a steerable needle that considers the risk level of the path in anatomical environment and the actual deflection of clinical needle is necessary. A novel pre-operative motion planner for a steerable needle controlled by robot is proposed. Our method utilizes sampling-based planner to compute candidate path in the reachable region, and the path solutions are optimized by calculating the cost of a path based on a cost map. The cost map, which is built based on repulsive field theory from CT image, encodes the information of the obstacle locations and the criticality of the anatomical environment. The empirical formula that can predict needle trajectory is obtained by insertion experiments. Experiments show that under the guidance of our planner, the positioning error in phantom made with gelatin and three-dimensional (3D) printed models is less than 1.1 mm. Comparing with the straight-line insertion method in the same phantom, the positioning error was reduced by 80%. The results indicate that the motion planner has the potential to provide effective guidance for robot-assisted puncture surgery while enhancing the position precision and patient safety.