This is a figurative use of the verb package, meaning "to consolidate items by placing them into a container of some kind".
In this instance, there was no physical container. The items were grouped in the digital record.
These loans were "bundled" together, such that the bad loans were mingled in with the not-so-bad loans, and these mixed bundles were offered as investments, as bonds, which are supposed to offer a fixed rate of return.
But that rate of return was dependent upon a normal, low rate of default on the underlying mortgages—upon defaults being the rare exception rather than a growing trend.
It was like a barrel of apples, many of them rotten, being sold by the barrel, rather than individually. Taking the apples out one by one and examining them individually, to determine whether you wanted to buy that barrel, was an effort most would not undertake to do when the greengrocer was considered reputable.