You need a nested loop because this is how the bubble sort works.
What you do is take the first item and compare it to the next one. If the one on the left is larger, they swap places, so the larger element is on the right side. Then you compare the next two pair (index 0 to index 1, then index 1 to index 2, then index 2 to index 3, etc). This ensures that by the time you reach the end of the list the last element is the largest in the list.
But everything else on the left side of the largest element is still unsorted.
So rinse and repeat. Compare two, put the larger one to the right side, and keep comparing with the next ones.
You don't need to go all the way all the time as the right side is already sorted containing the largest then the 2nd largest then the 3rd largest, etc elements.
I hope this helps. For more details, read the linked site that explains bubble sorting in detail.
Good luck!