I think you need to re-examine your expectations. Which two phones are you comparing specifically? Price doesn't tell us anything about the camera capabilities. There's multiple Lumia phones and multiple Motorola phones, each with different specs. All $78 tells me is you bought the phone used, so I can't even begin to guess which Lumia you have. $400 is buying you a complete phone, not just a camera, and that price could indicate a new, used, or refurbished phone.

How you use the camera makes a difference as well. Some of it is software based and you can overcome some limitations by using manual mode (if available) or using a third party app. Some of it is simple physics, such as pixel sizes in the camera sensors or recording at 60fps vs 30fps. Not to mention the tiny sensors on the phone are already at a huge disadvantage in low light.

If you can upload or link us to some examples, that would be helpful as well.

B. Diddy:
Do they also look dim on your computer screen"
Yes, the are are dark on win 10 PC.

Mooncraft:
My $78 NEW Walmart phone is a Lumia 640 .
I have had it for several years .

"If you can upload or link us to some examples, that would be helpful as well."
Let me check with BestBuy & see if I can keep it thru the 26th .
If so , I'll build a web page with examples of both videos .

If time is of the essence, you could also upload the videos to YouTube and link us to them right now. Photos can be uploaded direct to this post. When doing so, please provide the EXIF data that shows the ISO and shutter speed used if possible (likely found in a details option in your gallery's menu).

I looked up both phones. For anyone else looking into this, I found the camera specs for the Lumia 640 here:

From a hardware standpoint, the Z3 Play should outperform the 640 in every way. It has larger sensor pixels and aperture, which would be the biggest deciding factors in how well either camera would work in low light. It's possible your Z3 has a defective sensor, but I'm still leaning towards a software issue. For example, auto mode can have limits put on it by the programmer on how high to set the ISO (basically the sensitivity of the sensor) and how long to leave the shutter active. When comparing auto mode between phones, it's not unheard of to have vastly different results like you're seeing.

I would at least play around with the manual mode if you have it in the Z3, or download a third party app, to see if you get better results. This would help narrow down the issue. If this turns out to be a software issue and you wish to only use auto mode, then I would suggest returning the Z3 and finding something more to your liking.

You know you can just insert phone pictures right into your posts here on forum?
Using Tapatalk app it's easier then inserting attachment into email.
But on quality of pictures, I've been moto user since 2009 and had all major phones from Samsung, Sony, Google and LG. When it comes to quality, Moto has the worst camera in their phones and they haven't changed their tune since early days. But on the bright side, their battery life is much better then competition. So you win some you lose some. Nobody buys moto phones for their camera.