means that
devotion to spiritual values is incompatible with treating wealth as one's supreme master. Mammon personifies material riches in the biblical saying.
Mammon was the God of gold and riches
For example, youi cannot devote yourself to God and riches at the same time This is a situation where “You cannot serve God and Mammon” applies.