My guess is the friction fit slip fitting kept popping off and the pool company or owner hacked a solution for more friction by adding the tape. There’s a lot of water force coming out of return pipes and so I’ve often thought those types of friction fits are just a very poor solution.
@Rancho Cost-a-Lotta ’s suggestion is probably the best turnkey solution. Unfortunately if you want to permanently turn those 1-1/2” pipes into thread, there’s no easy way to do it. Either you have to glue a threaded PVC bushing into the pipe which will severely restrict the opening OR you have to glue a slip male X threaded female adapter into the pipe and there will be a big chunk of plastic hanging off the wall.
I don’t think there’s enough “meat” to the PVC pipe to tap it with threading nor would the internal diameter match any kind of standard PVC fitting.