If it's a "square taper" crank and you rode it while it was loose, you may have damaged the crank to the point where it will never stay tight again.
Aluminum square taper cranks have to be a very tight fit on the hard steel bottom bracket spindle and the recommended installation torque is very high. If the cranks get loose for what ever reason, usually because they weren't installed properly to begin with, the steel spindle will distort and damage the hole in the crank so that it will never fit properly again.
If that's the case, your only option is a new crank.