In recent years, there has been an increasing trend towards extending the coverage of passive optical networks (PONs) over large geographical areas. Long-reach PONs (LRPONs) are capable of extending the distance covered by PONs from 20 km to 100 km, leading to cost savings in the network operation by reducing the number of central offices. They have become widely deployed due to their ability to provide high-speed, long-distance data transmission over optical fibers. In addition, the next generation of optical access networks are expected to provide high-capacity mobile and wireless backhauling over a wide coverage area. However, this extended reach also requires the design of efficient dynamic bandwidth allocation (DBA) schemes to address the performance degradation caused by the increased propagation delay in LRPONs. The DBA schemes commonly used for upstream traffic transmission in traditional PONs are not well-suited for use in LRPONs due to their inefficiency in bandwidth utilization due to the increased round-trip time (RTT) between the optical line terminal (OLT) and the optical network unit (ONU). In this study, we present an efficient DBA algorithm, the Distance-Weighted Bandwidth Allocation DWDBA Algorithm, specifically enhanced for multi-wavelength LRPONs. Our DBA algorithm utilizes a scheduling policy that assigns weight vectors to Optical Network Units (ONUs) based on their distance from the Optical Line Terminal (OLT), sorting them accordingly without penalizing any ONU due to their distance. The DWDBA takes the laser tuning time into consideration. We conducted extensive simulations to evaluate the performance of the proposed algorithm under various scenarios and compared it to the IPACT algorithm. The results of the simulations show that the proposed algorithm outperformed the IPACT algorithm in terms of bandwidth utilization and queue delay.