Brain-computer interface (BCI) systems based on functional near-infrared spectroscopy (fNIRS) have been used as a way of facilitating communication between the brain and peripheral devices. The BCI provides an option to improve the walking pattern of people with poor walking dysfunction, by applying a rehabilitation process. A state-of-the-art step-wise BCI system includes data acquisition, pre-processing, channel selection, feature extraction, and classification. In fNIRS-based BCI (fNIRS-BCI), channel selection plays a vital role in enhancing the classification accuracy of the BCI problem. In this study, the concentration of blood oxygenation (HbO) in a resting state and in a walking state was used to decode the walking activity and the resting state of the subject, using channel selection by Least Absolute Shrinkage and Selection Operator (LASSO) homotopy-based sparse representation classification. The fNIRS signals of nine subjects were collected from the left hemisphere of the primary motor cortex. The subjects performed the task of walking on a treadmill for 10 s, followed by a 20 s rest. Appropriate filters were applied to the collected signals to remove motion artifacts and physiological noises. LASSO homotopy-based sparse representation was used to select the most significant channels, and then classification was performed to identify walking and resting states. For comparison, the statistical spatial features of mean, peak, variance, and skewness, and their combination, were used for classification. The classification results after channel selection were then compared with the classification based on the extracted features. The classifiers used for both methods were linear discrimination analysis (LDA), support vector machine (SVM), and logistic regression (LR). The study found that LASSO homotopy-based sparse representation classification successfully discriminated between the walking and resting states, with a better average classification accuracy (p < 0.016) of 91.32%. This research provides a step forward in improving the classification accuracy of fNIRS-BCI systems. The proposed methodology may also be used for rehabilitation purposes, such as controlling wheelchairs and prostheses, as well as an active rehabilitation training technique for patients with motor dysfunction.