A bill that would have fully legalized marijuana for medical purposes in Connecticut was narrowly defeated in the House of Representatives on Wednesday .