The first part of our sentence, "Robert took out a loan," is pretty straightforward: Subject plus verb plus object. Don't let that "out" throw you. Here it's just part of the verb, called a phrasal verb because it uses more than one word to convey an action. To "take out" means something different from "take." So "out" is part of the verb.
To understand the second part of the sentence, you need to know only two things: Prepositional phrases can be understood as modifiers and verbs ending in "ing" are sometimes also modifiers.
Prepositions like "with" take objects — "with ice cream," "with pleasure," "with them." These combinations are called prepositional phrases. They're basically modifiers. They shed more light on a thing or an action.
In "The man with the silver tongue," the prepositional phrase modifies the noun "man." In "Ann went with Joe," the prepositional phrase modifies the action "went," telling us more about what happened.
In Joel's sentence, "with his house serving as collateral" modifies Robert's action, giving more explanation about how he took out the loan. This use of a prepositional phrase is perfectly grammatical. So we can set aside the "with" part of Joel's question and look at the "ing" part.
Verbs ending in "ing" can be part of a verb phrase, "I am running." They can be gerunds, which work as nouns. "Running is fun." Or they can work as modifiers called participles. "I saw Bill running." Here, the object of the verb is "Bill." That "running" at the end is a modifier that tells us more about Bill. Compare that sentence to "I saw the running of Bill," in which running is the true object of the verb.
So in "with his house serving as collateral" the object of the preposition is "his house" and "serving" tells us more about the house. So we know this sentence is grammatical.