Yes, of course there could be other causes including pain from the idneys, as you have surmised. This could be caused by a renal calcuolus or an infection of the kidney. But in that case the pain would occur at other times also and not just on lying down and would usually be associated with other signs like blood or discolouration of the urine or a burning sensation on urination. Other abdominal causes of such pain also would not be associated with posture. So a pain which occurs only on lying down is usually related to a muscular pain.
Still, you should always consult a doctor for a confirmation.
I hope this answer was helpful. If you need more information, feel free to ask. For accepting this answer, please click on the green 'accept' button below. Feedback/Bonus will be warmly appreciated.