Frictional force is a constant force acting opposite to the direction of motion
A constant force only makes an object to move in one direction
A time varying force makes an object to move in one direction with its speed increasing
Force due to a spring, keeps varying, as the object is moved away from its mean position and thus acts as a restoring force