The context in the sermon on the mount here is about laying up treasure in verses 19-23 and worry about not having enough treasure in verses 25-34. In both cases the god is mammon and it prevents someone from serving the Lord. Serving the Lord is a theme throughout the entire Bible.