Jesus states that no one can serve two masters.
Matthew 6:24, The New Testament, The Church of Jesus Christ of Latter-day Saints, accessed October 4, 2023
No man can serve two masters: for either he will hate the one, and love the other; or else he will hold to the one, and despise the other. Ye cannot serve God and mammon.