In order to make ATP, you have to spend ATP. So Glycolysis need 2 ATP to break down the glucose, which results in 4 ATP, but a net gain of 2 ATP. For example, if you want to start selling cookies, you first have to put in some money for supplies,right? Lets say supplies are $2. Then you sell your cookies and get $4, but not really, because the $2 was used for supplies