The APA manual states in section 9.35 that you can use the default formatting in your word processing system, so any automatic underlining that occurs with the DOI or URL is fine. We recommend you be consistent with your choice throughout your References List.
The default underlining that occurs in word processing systems such as Microsoft Word may increase functionality, which is recommended.