How to convert a low-pass Gaussian filter to a high pass filter
The simplest option is to remove the low-pass signal from the data. Just subtract the outcome of your code from the original image. This amounts to computing:

$$I_\textrm{high} = \delta \ast I - g\ast I  = (\delta -g) \ast I\,.$$

The term $\delta \ast I$ corresponds to the convolution of a Dirac delta to the image, which is an invariant operation.
As the sum of the coefficients of the $\delta$ filter is one, like $g$, the resulting filter $\delta -g$ has a zero sum. 
Warning though: a filter whose coefficients sum to one is not necessarily an high-pass filter. It is a low-cut, and can be for instance a band-pass.

A more convincing method consists in using the modulation property:  you can multiply the coefficients of the low-pass filter pointwise by alternating $1$ and $-1$ (alternating signs are discussed here: why the sum of masks should be one?). The following code does it in 1D:

b = [1 4 6 4 1];b=b/sum(b) ;a=1;
c = b.* (-1).^(1:length(b)); 
[hb,w] = freqz(b,a,1024);
[hc,w] = freqz(c,a,1024);
figure(1);plot(w,abs([hb,(hc)]));axis tight




The adaptation in 2D follows:



N =13;
%%horizontal and vertical coordinates
coordinates = -floor(N/2) : floor(N/2);
[X Y] = meshgrid(coordinates, coordinates);
sigma=2;

gfilter = exp(-(X.^2 + Y.^2)/(2*sigma.^2));
gfilter = gfilter/sum(gfilter(:));

gridInv = (-1).^(X+Y);
hfilter = gfilter.*gridInv;

subplot(2,2,1);
mesh(gfilter);
subplot(2,2,2);
mesh(hfilter);

subplot(2,2,3);
imagesc(abs(fftshift(fft2(gfilter))));
subplot(2,2,4);
imagesc(abs(fftshift(fft2(hfilter))));