In this study, carboxymethylated cellulose nanofibril (CMCNF) foams were prepared through oven and freeze drying and chemically modified through the layer-by-layer (LbL) treatment of cationic (i.e., poly(diallyldimethylammonium chloride)) and anionic (i.e., poly(sodium 4-styrenesulfonate)) polyelectrolytes. The alternative adsorption of each polyelectrolyte on a CMCNF foam was confirmed by charge demand and Fourier transform infrared and energy-dispersive X-ray spectroscopic analyses. The cumulative adsorbed amount of polyelectrolytes in the freeze-dried foam increased up to two layers and reached a plateau, but the oven-dried foam exhibited a slower and gradual polyelectrolyte adsorption with the increasing layer number. The anionic dye adsorption was found superior when the cationic polyelectrolyte was adsorbed at the outermost layer of the CMCNF foam. The dye removal performance differed depending on the foam pore structure. Consequently, the surface charge of the CMCNF foam was effectively modified by the LbL treatment of polyelectrolytes, which can expand the application of the CMCNF foam in cationic or anionic dye removal.