Yes it can. [Gonzales v. Raich]
The issue was not in dispute in that case:
Respondents in this case do not dispute that passage of the CSA, as part of the Comprehensive Drug Abuse Prevention and Control Act, was well within Congress' commerce power
In my opinion, by the way, Wickard v. Filburn, the New Deal era decision that says making something for yourself (i.e. growing wheat to feed your own chickens, or growing marijuana to use yourself) affects interstate commerce (because you otherwise might have bought it instead, affecting the price) and can thus be regulated, is a travesty that is long overdue for the Supremes to revisit and reverse, as they sometimes do when a previous court broke something substantial.
But even if you agree that feeding your own wheat to your own chickens is a suitable subject for federal regulation under the commerce clause, don't you think it's a stretch to say that affecting the price of a banned substance by NOT buying it on the illegal market is a legitimate reason for the Federal Government to ban your growing and consuming your own plants? Either way you don't buy in interstate commerce, so how can the difference in your behavior affect it? (Or was it Congress' intent for you to buy illegal drugs?)
Sometimes more than half the Supreme Court justices follow some argument to a point beyond sanity.