Different results for seperable filtering v/s direct filtering on 2-D image in MATLAB
Turns out that when doing filtering by columns, i.e. for the following section

for j = 1:size(I,2)
   I_seperable(:,j) = imfilter(double(I2(:,j)),g1,'circular','same','conv');
end


we need to make sure the filter is aligned along columns. Changing g1 to g1' makes the difference almost zero as seen below.

ans =

   1.9782e-11