A penalized regression model for functional data with spatial dependence