This study addresses the challenge of bearing-only target localization with sensor bias contamination. To enhance the system's observability, inspired by plant phototropism, we propose a control barrier function (CBF)-based method for UAV motion planning. The rank criterion provides only qualitative observability results. We employ the condition number for a quantitative analysis, identifying key influencing factors. After that, a multi-objective, nonlinear optimization problem for UAV trajectory planning is formulated and solved using the proposed Nonlinear Constrained Multi-Objective Gray Wolf Optimization Algorithm (NCMOGWOA). Simulations validate our approach, showing a threefold reduction in the condition number, significantly enhancing observability. The algorithm outperforms others in terms of localization accuracy and convergence, achieving the lowest Generational Distance (GD) (7.3442) and Inverted Generational Distance (IGD) (8.4577) metrics. Additionally, we explore the effects of the CBF attenuation rates and initial flight path angles.