Here is an idea. The \sparsetable command has three arguments: the number of rows, the number of columns and the list of entries.
Each item in the list has four arguments: the row index, the column index, the entry and the color. The order is arbitrary.
The macro parses the list, storing the items in a property list that is then used for populating the table body; we exploit the fact that \prop_item:Nn returns nothing if there is no corresponding property.
\documentclass{article}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\sparsetable}{mmm}
{% #1 = number of rows, #2 = number of columns, #3 = list of entries
\prop_clear:N \l_demitau_sparse_table_prop
\clist_map_inline:nn { #3 } { \demitau_sparse_table_cell:nnnn ##1 }
\demitau_sparse_table:nn { #1 } { #2 }
}
\prop_new:N \l_demitau_sparse_table_prop
\tl_new:N \l_demitau_sparse_table_body_tl
\cs_new_protected:Nn \demitau_sparse_table_cell:nnnn
{
\prop_put:Nnn \l_demitau_sparse_table_prop { #1,#2 } { \cellcolor{#4}#3 }
}
\cs_new_protected:Nn \demitau_sparse_table:nn
{
\tl_clear:N \l_demitau_sparse_table_body_tl
\int_step_inline:nnnn { 1 } { 1 } { #1 }
{
\int_step_inline:nnnn { 1 } { 1 } { #2 - 1 }
{
\tl_put_right:Nx \l_demitau_sparse_table_body_tl
{
\prop_item:Nn \l_demitau_sparse_table_prop { ##1,####1 } &
}
}
% no trailing & in the last column
\tl_put_right:Nx \l_demitau_sparse_table_body_tl
{
\prop_item:Nn \l_demitau_sparse_table_prop { ##1,#2 }
}
\tl_put_right:Nn \l_demitau_sparse_table_body_tl { \\ }
}
\begin{tabular}{*{#2}{c}}
\tl_use:N \l_demitau_sparse_table_body_tl
\end{tabular}
}
\ExplSyntaxOff
\begin{document}
\sparsetable{10}{5}{
{1}{1}{a}{red},
{1}{4}{b}{blue!50},
{3}{2}{c}{blue!70},
{4}{5}{d}{green},
{10}{1}{e}{gray!70},
{10}{5}{f}{green},
{5}{1}{0}{white},
{6}{1}{0}{white},
{7}{1}{0}{white},
{8}{1}{0}{white},
{9}{1}{0}{white},
}
\end{document}

A couple of changes in the \demitau_sparse_table:nn function gives rules in the table:
\cs_new_protected:Nn \demitau_sparse_table:nn
{
\tl_clear:N \l_demitau_sparse_table_body_tl
\int_step_inline:nnnn { 1 } { 1 } { #1 }
{
\int_step_inline:nnnn { 1 } { 1 } { #2 - 1 }
{
\tl_put_right:Nx \l_demitau_sparse_table_body_tl
{
\prop_item:Nn \l_demitau_sparse_table_prop { ##1,####1 } &
}
}
% no trailing & in the last column
\tl_put_right:Nx \l_demitau_sparse_table_body_tl
{
\prop_item:Nn \l_demitau_sparse_table_prop { ##1,#2 }
}
\tl_put_right:Nn \l_demitau_sparse_table_body_tl { \\ \hline }
}
\begin{tabular}{|*{#2}{c|}}
\hline
\tl_use:N \l_demitau_sparse_table_body_tl
\end{tabular}
}
