I just recently started having lower back pain on both sides only when I have a bowel movement. What could it be?

Disc herniation. Hello: Pain with bowel straining might suggest a herniated disc. Discs hurt with sitting and straining (Valsalva). You might want to get examined by a physiatrist specialized in spine care.
Muscle pulling or nerve pressure. This could be muscle pull or pressure on the nerves in the back. Your physician can help clarify.