Lists in Maple are immutable, that is, with l := 2 you create a copy of l and change the first element of this second list. You now have two lists in memory. Repeating this many times produces a different copy of the list each time; as a result, this error may occur because copying the entire list requires a significant amount of memory.
Arrays, on the other hand, can be modified in place and therefore use less memory. For example, by reassigning A, you do not allocate new memory.