Cloud computing has revolutionized how Software as a Service (SaaS) suppliers deliver applications by leasing shareable resources from Infrastructure as a Service (IaaS) suppliers. However, meeting users' Quality of Service (QoS) parameters while maximizing profits from the cloud infrastructure presents a significant challenge. This study addresses this challenge by proposing an Enhanced Harris Hawks Optimization (EHHO) algorithm for cloud task scheduling, specifically designed to satisfy Service Level Agreements (SLAs), meet users QoS requirements, and enhance resource utilization efficiency. Drawing inspiration from Harris's falcon hunting habits in nature, the basic HHO algorithm has shown promise in finding optimal solutions to specific problems. However, it often suffers from convergence to local optima, impairing solution quality. To mitigate this issue, our study enhances the HHO algorithm by introducing an exploration factor that optimizes parameters and improves its exploration capabilities. The proposed EHHO algorithm is assessed against established optimization algorithms, including Genetic Algorithm (GA), Ant Colony Optimization (ACO), and Particle Swarm Optimization (PSO). The results demonstrate that our method significantly improves the makespan for GA, ACO, and PSO by 19.2%, 17.1%, and 20.4%, respectively, while also achieving improvements of 17.1%, 17.3%, and 17.2% for BigDataBench workloads. Furthermore, our EHHO algorithm exhibits a substantial reduction in SLA violations compared to PSO, ACO, and GA, achieving improvements of 55.2%, 41.4%, and 33.6%, respectively, for general workloads, and 61.9%, 23.1%, and 52.7%, respectively, for BigDataBench workloads.